Skip to content

Commit

Permalink
tests: Use $this->expectException() everywhere instead
Browse files Browse the repository at this point in the history
  • Loading branch information
nilmerg committed Oct 7, 2021
1 parent 5357843 commit c36286a
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions tests/ValidatorChainTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -275,28 +275,26 @@ public function testMerge()
$this->assertTrue($validators->getValidatorsThatBreakTheChain()->contains($callbackValidator));
}

/**
* @expectedException InvalidArgumentException
*/
public function testArraySpecExceptionIfNameIsMissing()
{
$spec = [
[
]
];

$this->expectException(InvalidArgumentException::class);

(new ValidatorChain())->addValidators($spec);
}

/**
* @expectedException InvalidArgumentException
*/
public function testNameToOptionsSpecExceptionIfClassDoesNotExist()
{
$spec = [
'doesnotexist' => null
];

$this->expectException(InvalidArgumentException::class);

(new ValidatorChain())->addValidators($spec);
}
}

0 comments on commit c36286a

Please sign in to comment.