Skip to content

Commit 4a90c3c

Browse files
Merge pull request #677 from MauricioFauth/phpunit-12-CLI-AllowMockObjectsWithoutExpectations
Fix PHPUnit 12 notice in CLITest
2 parents bb08407 + 52000c2 commit 4a90c3c

3 files changed

Lines changed: 13 additions & 0 deletions

File tree

‎phpstan-baseline.neon‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2757,6 +2757,12 @@ parameters:
27572757
count: 1
27582758
path: tests/Utils/BufferedQueryTest.php
27592759

2760+
-
2761+
message: '#^Attribute class PHPUnit\\Framework\\Attributes\\AllowMockObjectsWithoutExpectations does not exist\.$#'
2762+
identifier: attribute.notFound
2763+
count: 1
2764+
path: tests/Utils/CLITest.php
2765+
27602766
-
27612767
message: '#^Dynamic call to static method PHPUnit\\Framework\\Assert\:\:assertEquals\(\)\.$#'
27622768
identifier: staticMethod.dynamicCall

‎psalm-baseline.xml‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1259,6 +1259,11 @@
12591259
<code><![CDATA[unserialize]]></code>
12601260
</PossiblyUnusedMethod>
12611261
</file>
1262+
<file src="tests/Utils/CLITest.php">
1263+
<UndefinedAttributeClass>
1264+
<code><![CDATA[AllowMockObjectsWithoutExpectations]]></code>
1265+
</UndefinedAttributeClass>
1266+
</file>
12621267
<file src="tests/Utils/QueryTest.php">
12631268
<PossiblyNullArgument>
12641269
<code><![CDATA[$parser->list]]></code>

‎tests/Utils/CLITest.php‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,15 @@
66

77
use PhpMyAdmin\SqlParser\Tests\TestCase;
88
use PhpMyAdmin\SqlParser\Utils\CLI;
9+
use PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations;
910
use PHPUnit\Framework\Attributes\DataProvider;
1011

1112
use function dirname;
1213
use function exec;
1314

1415
use const PHP_BINARY;
1516

17+
#[AllowMockObjectsWithoutExpectations]
1618
class CLITest extends TestCase
1719
{
1820
/** @param array<string, bool|string>|false $getopt */

0 commit comments

Comments
 (0)