Skip to content

Commit

Permalink
Merge pull request #10475 from kkmuffme/fix-old-psalm-version-in-tests
Browse files Browse the repository at this point in the history
fix psalm v4 hardcoded in tests
  • Loading branch information
orklah committed Dec 12, 2023
2 parents f268dfa + 20ae081 commit 9a57645
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 11 deletions.
5 changes: 3 additions & 2 deletions tests/Config/ConfigTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
use Psalm\Internal\Provider\Providers;
use Psalm\Internal\RuntimeCaches;
use Psalm\Internal\Scanner\FileScanner;
use Psalm\Internal\VersionUtils;
use Psalm\Issue\TooManyArguments;
use Psalm\Issue\UndefinedFunction;
use Psalm\Tests\Config\Plugin\FileTypeSelfRegisteringPlugin;
Expand Down Expand Up @@ -58,11 +59,11 @@ public static function setUpBeforeClass(): void
self::$config = new TestConfig();

if (!defined('PSALM_VERSION')) {
define('PSALM_VERSION', '4.0.0');
define('PSALM_VERSION', VersionUtils::getPsalmVersion());
}

if (!defined('PHP_PARSER_VERSION')) {
define('PHP_PARSER_VERSION', '4.0.0');
define('PHP_PARSER_VERSION', VersionUtils::getPhpParserVersion());
}
}

Expand Down
5 changes: 3 additions & 2 deletions tests/Config/PluginTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use Psalm\Internal\Provider\FakeFileProvider;
use Psalm\Internal\Provider\Providers;
use Psalm\Internal\RuntimeCaches;
use Psalm\Internal\VersionUtils;
use Psalm\IssueBuffer;
use Psalm\Plugin\EventHandler\AfterCodebasePopulatedInterface;
use Psalm\Plugin\EventHandler\AfterEveryFunctionCallAnalysisInterface;
Expand Down Expand Up @@ -46,11 +47,11 @@ public static function setUpBeforeClass(): void
self::$config = new TestConfig();

if (!defined('PSALM_VERSION')) {
define('PSALM_VERSION', '4.0.0');
define('PSALM_VERSION', VersionUtils::getPsalmVersion());
}

if (!defined('PHP_PARSER_VERSION')) {
define('PHP_PARSER_VERSION', '4.0.0');
define('PHP_PARSER_VERSION', VersionUtils::getPhpParserVersion());
}
}

Expand Down
5 changes: 3 additions & 2 deletions tests/ProjectCheckerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use Psalm\Internal\Provider\FakeFileProvider;
use Psalm\Internal\Provider\Providers;
use Psalm\Internal\RuntimeCaches;
use Psalm\Internal\VersionUtils;
use Psalm\IssueBuffer;
use Psalm\Plugin\EventHandler\AfterCodebasePopulatedInterface;
use Psalm\Plugin\EventHandler\Event\AfterCodebasePopulatedEvent;
Expand Down Expand Up @@ -43,11 +44,11 @@ public static function setUpBeforeClass(): void
self::$config = new TestConfig();

if (!defined('PSALM_VERSION')) {
define('PSALM_VERSION', '4.0.0');
define('PSALM_VERSION', VersionUtils::getPsalmVersion());
}

if (!defined('PHP_PARSER_VERSION')) {
define('PHP_PARSER_VERSION', '4.0.0');
define('PHP_PARSER_VERSION', VersionUtils::getPhpParserVersion());
}
}

Expand Down
3 changes: 2 additions & 1 deletion tests/ReportOutputTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use Psalm\Internal\Provider\FakeFileProvider;
use Psalm\Internal\Provider\Providers;
use Psalm\Internal\RuntimeCaches;
use Psalm\Internal\VersionUtils;
use Psalm\IssueBuffer;
use Psalm\Report;
use Psalm\Report\JsonReport;
Expand Down Expand Up @@ -109,7 +110,7 @@ public function testSarifReport(): void
'driver' => [
'name' => 'Psalm',
'informationUri' => 'https://psalm.dev',
'version' => '4.0.0',
'version' => VersionUtils::getPsalmVersion(),
'rules' => [
[
'id' => '246',
Expand Down
5 changes: 3 additions & 2 deletions tests/StubTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
use Psalm\Internal\Provider\FakeFileProvider;
use Psalm\Internal\Provider\Providers;
use Psalm\Internal\RuntimeCaches;
use Psalm\Internal\VersionUtils;
use Psalm\Tests\Internal\Provider\FakeParserCacheProvider;

use function define;
Expand All @@ -37,11 +38,11 @@ public static function setUpBeforeClass(): void
self::$config = new TestConfig();

if (!defined('PSALM_VERSION')) {
define('PSALM_VERSION', '4.0.0');
define('PSALM_VERSION', VersionUtils::getPsalmVersion());
}

if (!defined('PHP_PARSER_VERSION')) {
define('PHP_PARSER_VERSION', '4.0.0');
define('PHP_PARSER_VERSION', VersionUtils::getPhpParserVersion());
}
}

Expand Down
5 changes: 3 additions & 2 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use Psalm\Internal\RuntimeCaches;
use Psalm\Internal\Type\TypeParser;
use Psalm\Internal\Type\TypeTokenizer;
use Psalm\Internal\VersionUtils;
use Psalm\IssueBuffer;
use Psalm\Tests\Internal\Provider\FakeParserCacheProvider;
use Psalm\Type\Union;
Expand Down Expand Up @@ -56,11 +57,11 @@ public static function setUpBeforeClass(): void
ini_set('memory_limit', '-1');

if (!defined('PSALM_VERSION')) {
define('PSALM_VERSION', '4.0.0');
define('PSALM_VERSION', VersionUtils::getPsalmVersion());
}

if (!defined('PHP_PARSER_VERSION')) {
define('PHP_PARSER_VERSION', '4.0.0');
define('PHP_PARSER_VERSION', VersionUtils::getPhpParserVersion());
}

parent::setUpBeforeClass();
Expand Down

0 comments on commit 9a57645

Please sign in to comment.