diff --git a/lib/Assert/LazyAssertionException.php b/lib/Assert/LazyAssertionException.php index a301157c..d0a5fbc9 100644 --- a/lib/Assert/LazyAssertionException.php +++ b/lib/Assert/LazyAssertionException.php @@ -13,7 +13,7 @@ namespace Assert; -class LazyAssertionException extends \InvalidArgumentException +class LazyAssertionException extends InvalidArgumentException { /** * @var InvalidArgumentException[] @@ -38,7 +38,7 @@ public static function fromErrors(array $errors) public function __construct($message, array $errors) { - parent::__construct($message, 0); + parent::__construct($message, 0, null, null); $this->errors = $errors; } diff --git a/tests/Assert/Tests/LazyAssertionTest.php b/tests/Assert/Tests/LazyAssertionTest.php index 55d9b80c..df4b8f1b 100644 --- a/tests/Assert/Tests/LazyAssertionTest.php +++ b/tests/Assert/Tests/LazyAssertionTest.php @@ -177,4 +177,14 @@ public function provideDataToTestThatSetExceptionClassWillNotAcceptInvalidExcept 'other exception' => array('Exception'), ); } + + public function testLazyAssertionExceptionExtendsInvalidArgumentException() + { + $this->setExpectedException('\Assert\InvalidArgumentException'); + + Assert::lazy()->tryAll() + ->that(10, 'foo')->float()->greaterThan(100) + ->that(null, 'foo')->notEmpty()->string() + ->verifyNow(); + } }