-
Notifications
You must be signed in to change notification settings - Fork 187
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
Make LazyAssertion open for extension #285
base: master
Are you sure you want to change the base?
Make LazyAssertion open for extension #285
Conversation
/** @var string */ | ||
protected static $lazyAssertionClass = LazyAssertion::class; | ||
|
||
public static function that($value, $defaultMessage = null, $defaultPropertyPath = null, array $context = []) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line generates an appropriate error when running static analysis.
$ composer assert:sa-tests
> vendor/bin/phpstan analyse --configuration=phpstan-tests.neon --no-progress --ansi -l 7 tests
Fatal error: Declaration of Assert\Tests\Fixtures\ContextAware\Assert::that($value, $defaultMessage = NULL, string $defaultPropertyPath = NULL, array $context = Array) must be compatible with Assert\Assert::that($value, $defaultMessage = NULL, string $defaultPropertyPath = NULL): Assert\AssertionChain in /Users/richardquadling/dev/php/beberlei/tests/Assert/Tests/Fixtures/ContextAware/Assert.php on line 19
PHP Fatal error: Declaration of Assert\Tests\Fixtures\ContextAware\Assert::that($value, $defaultMessage = NULL, string $defaultPropertyPath = NULL, array $context = Array) must be compatible with Assert\Assert::that($value, $defaultMessage = NULL, string $defaultPropertyPath = NULL): Assert\AssertionChain in /Users/richardquadling/dev/php/beberlei/tests/Assert/Tests/Fixtures/ContextAware/Assert.php on line 19
Script vendor/bin/phpstan analyse --configuration=phpstan-tests.neon --no-progress --ansi -l 7 tests handling the assert:sa-tests event returned with error code 255
use Assert\Tests\Fixtures\ContextAware\LazyAssertion; | ||
use PHPUnit\Framework\TestCase; | ||
|
||
class ContextAwareLazyAssertion extends TestCase |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As this class does not have Test
in the name, it is not run by PHPUnit. Renaming it to ContextAwareLazyAssertionTest
, reveals the error found by static analysis.
49aef74
to
d6d2e8d
Compare
No description provided.