diff --git a/tests/Config/ConfigTest.php b/tests/Config/ConfigTest.php index d0aa56b1cc0..dd6a3fa6b80 100644 --- a/tests/Config/ConfigTest.php +++ b/tests/Config/ConfigTest.php @@ -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( diff --git a/tests/Config/PluginTest.php b/tests/Config/PluginTest.php index 61747f6b35f..9c3297633f6 100644 --- a/tests/Config/PluginTest.php +++ b/tests/Config/PluginTest.php @@ -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')) { diff --git a/tests/ProjectCheckerTest.php b/tests/ProjectCheckerTest.php index 3e7bf7af31c..da8f75fe0c2 100644 --- a/tests/ProjectCheckerTest.php +++ b/tests/ProjectCheckerTest.php @@ -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')) {