Skip to content

Commit e3c7c3f

Browse files
committed
SignDataTest: new expectException usage
1 parent 3456f90 commit e3c7c3f

1 file changed

Lines changed: 7 additions & 12 deletions

File tree

tests/Transaction/Factory/SignDataTest.php

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -57,33 +57,28 @@ public function testCase(ScriptInterface $rs = null, ScriptInterface $ws = null,
5757
}
5858
}
5959

60-
/**
61-
* @expectedException \RuntimeException
62-
* @expectedExceptionMessage Witness script requested but not set
63-
*/
6460
public function testThrowsIfUnknownWSRequested()
6561
{
6662
$signData = new SignData();
63+
$this->expectException(\RuntimeException::class);
64+
$this->expectExceptionMessage("Witness script requested but not set");
6765
$signData->getWitnessScript();
6866
}
6967

70-
/**
71-
* @expectedException \RuntimeException
72-
* @expectedExceptionMessage Redeem script requested but not set
73-
*/
7468
public function testThrowsIfUnknownRSRequested()
7569
{
7670
$signData = new SignData();
71+
$this->expectException(\RuntimeException::class);
72+
$this->expectExceptionMessage("Redeem script requested but not set");
7773
$signData->getRedeemScript();
7874
}
7975

80-
/**
81-
* @expectedException \RuntimeException
82-
* @expectedExceptionMessage Signature policy requested but not set
83-
*/
8476
public function testThrowsIfUnknownSignaturePolicyRequested()
8577
{
8678
$signData = new SignData();
79+
$this->expectException(\RuntimeException::class);
80+
$this->expectExceptionMessage("Signature policy requested but not set");
81+
8782
$signData->getSignaturePolicy();
8883
}
8984
}

0 commit comments

Comments
 (0)