Skip to content

Commit

Permalink
TransactionTest: new expectException usage
Browse files Browse the repository at this point in the history
  • Loading branch information
afk11 committed Apr 17, 2021
1 parent 24a87f6 commit 855d541
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions tests/Transaction/TransactionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ public function testSetVersion()
*/
public function testSetVersionException()
{
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage("Transaction version is outside valid range");

new Transaction(4294967999);
}

Expand All @@ -69,29 +72,23 @@ public function testSetLockTime()
$this->assertEquals($lockTime, $tx->getLockTime());
}

/**
* @expectedException \Exception
*/
public function testSetLockTimeException()
{
$this->expectException(\InvalidArgumentException::class);
new Transaction(1, [], [], [], 4294967297);
}

/**
* @expectedException \Exception
*/
public function testGetInputException()
{
$tx = new Transaction();
$this->expectException(\RuntimeException::class);
$tx->getInput(0);
}

/**
* @expectedException \Exception
*/
public function testGetOutputException()
{
$tx = new Transaction();
$this->expectException(\RuntimeException::class);
$tx->getOutput(0);
}

Expand Down

0 comments on commit 855d541

Please sign in to comment.