Skip to content

Commit 5e06d66

Browse files
committed
SignerTest: new expectException usage
1 parent e3c7c3f commit 5e06d66

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tests/Transaction/Factory/SignerTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ public function getSimpleSpendCases(EcAdapterInterface $ecAdapter)
278278
/**
279279
* @return array
280280
*/
281-
public function getSimpleSpendVectors()
281+
public function getSimpleSpendVectors(): array
282282
{
283283
$vectors = [];
284284
foreach ($this->getEcAdapters() as $adapterFixture) {
@@ -295,8 +295,6 @@ public function getSimpleSpendVectors()
295295
* @param EcAdapterInterface $ecAdapter
296296
* @param ScriptInterface $script
297297
* @dataProvider getSimpleSpendVectors
298-
* @expectedException \RuntimeException
299-
* @expectedExceptionMessage Signing with the wrong private key
300298
*/
301299
public function testRejectsWrongKey(EcAdapterInterface $ecAdapter, ScriptInterface $script)
302300
{
@@ -312,6 +310,8 @@ public function testRejectsWrongKey(EcAdapterInterface $ecAdapter, ScriptInterfa
312310

313311
$txOut = new TransactionOutput(5000000000, $script);
314312
$signer = new Signer($tx, $ecAdapter);
313+
$this->expectException(\RuntimeException::class);
314+
$this->expectExceptionMessage("Signing with the wrong private key");
315315
$signer->input(0, $txOut)->sign($privateKey, SigHash::ALL);
316316
}
317317

0 commit comments

Comments
 (0)