Skip to content

Commit

Permalink
Fix VariadicTest when running phpunit with args
Browse files Browse the repository at this point in the history
e.g:
./vendor/bin/phpunit --filter Psalm\\\\Tests\\\\VariadicTest
  • Loading branch information
MoonE committed Nov 10, 2024
1 parent 0f796f1 commit a09b186
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/VariadicTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,15 @@ class VariadicTest extends TestCase
{
use ValidCodeAnalysisTestTrait;

public static function setUpBeforeClass(): void
{
parent::setUpBeforeClass();

// hack to isolate Psalm from PHPUnit cli arguments
global $argv;
$argv = [];
}

public function testVariadicArrayBadParam(): void
{
$this->expectExceptionMessage('InvalidScalarArgument');
Expand Down

0 comments on commit a09b186

Please sign in to comment.