Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update LazyAssertionException.php #187

Merged
merged 4 commits into from
Dec 2, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/Assert/LazyAssertionException.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

namespace Assert;

class LazyAssertionException extends \InvalidArgumentException
class LazyAssertionException extends InvalidArgumentException
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add a test to assert that LazyAssertionException extends Assert\InvalidArgumentException?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

{
/**
* @var InvalidArgumentException[]
Expand All @@ -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;
}
Expand Down
10 changes: 10 additions & 0 deletions tests/Assert/Tests/LazyAssertionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}