Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix psalm v4 hardcoded in tests #10475

Merged
merged 1 commit into from
Dec 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading