Skip to content

Commit

Permalink
Fix the tests broken when running with Paratest
Browse files Browse the repository at this point in the history
The break was introduced in #10483
  • Loading branch information
weirdan committed Oct 12, 2024
1 parent d747f65 commit 3e78a20
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/Config/ConfigTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1334,6 +1334,10 @@ function handleThrow(I $e) : void {

public function testModularConfig(): void
{
// hack to isolate Psalm from PHPUnit arguments
global $argv;
$argv = [];

$root = __DIR__ . '/../fixtures/ModularConfig';
$config = Config::loadFromXMLFile($root . '/psalm.xml', $root);
$this->assertEquals(
Expand Down
4 changes: 4 additions & 0 deletions tests/Config/PluginTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ class PluginTest extends TestCase

public static function setUpBeforeClass(): void
{
// hack to isolate Psalm from PHPUnit cli arguments
global $argv;
$argv = [];

self::$config = new TestConfig();

if (!defined('PSALM_VERSION')) {
Expand Down
4 changes: 4 additions & 0 deletions tests/ProjectCheckerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ class ProjectCheckerTest extends TestCase

public static function setUpBeforeClass(): void
{
// hack to stop Psalm seeing the phpunit arguments
global $argv;
$argv = [];

self::$config = new TestConfig();

if (!defined('PSALM_VERSION')) {
Expand Down

0 comments on commit 3e78a20

Please sign in to comment.