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

fix: Make sure Assert::assertIsList correctly asserts an array as list #213

Merged
merged 1 commit into from
Nov 12, 2024
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
3 changes: 3 additions & 0 deletions extension.neon
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ parameters:
- markTestIncomplete
- markTestSkipped
stubFiles:
- stubs/Assert.stub
- stubs/AssertionFailedError.stub
- stubs/ExpectationFailedException.stub
- stubs/InvocationMocker.stub
- stubs/MockBuilder.stub
- stubs/MockObject.stub
Expand Down
13 changes: 13 additions & 0 deletions stubs/Assert.stub
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

namespace PHPUnit\Framework;

abstract class Assert
{
/**
* @phpstan-assert list $array
*
* @throws ExpectationFailedException
*/
final public static function assertIsList(mixed $array, string $message = ''): void {}
}
8 changes: 8 additions & 0 deletions stubs/AssertionFailedError.stub
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

namespace PHPUnit\Framework;

class AssertionFailedError extends \Exception
{

}
8 changes: 8 additions & 0 deletions stubs/ExpectationFailedException.stub
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

namespace PHPUnit\Framework;

final class ExpectationFailedException extends AssertionFailedError
{

}