From 4b66f5c996865a6085983cc90b5c8a242d1959e7 Mon Sep 17 00:00:00 2001 From: Ondrej Mirtes Date: Wed, 24 Apr 2024 16:05:48 +0200 Subject: [PATCH] Fix --- tests/Rules/Doctrine/ORM/QueryBuilderDqlRuleSlowTest.php | 4 ++++ tests/Rules/Doctrine/ORM/QueryBuilderDqlRuleTest.php | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/tests/Rules/Doctrine/ORM/QueryBuilderDqlRuleSlowTest.php b/tests/Rules/Doctrine/ORM/QueryBuilderDqlRuleSlowTest.php index e6494866..4c59b7de 100644 --- a/tests/Rules/Doctrine/ORM/QueryBuilderDqlRuleSlowTest.php +++ b/tests/Rules/Doctrine/ORM/QueryBuilderDqlRuleSlowTest.php @@ -5,6 +5,7 @@ use PHPStan\Rules\Rule; use PHPStan\Testing\RuleTestCase; use PHPStan\Type\Doctrine\ObjectMetadataResolver; +use const PHP_VERSION_ID; /** * @extends RuleTestCase @@ -22,6 +23,9 @@ protected function getRule(): Rule public function testRule(): void { + if (PHP_VERSION_ID < 70300) { + self::markTestSkipped('For some reason PHP 7.2 cannot recover from Trying to get property value of non-object'); + } $this->analyse([__DIR__ . '/data/query-builder-dql.php'], [ [ "QueryBuilder: [Syntax Error] line 0, col 66: Error: Expected end of string, got ')'\nDQL: SELECT e FROM PHPStan\Rules\Doctrine\ORM\MyEntity e WHERE e.id = 1)", diff --git a/tests/Rules/Doctrine/ORM/QueryBuilderDqlRuleTest.php b/tests/Rules/Doctrine/ORM/QueryBuilderDqlRuleTest.php index 1166c816..7b04762e 100644 --- a/tests/Rules/Doctrine/ORM/QueryBuilderDqlRuleTest.php +++ b/tests/Rules/Doctrine/ORM/QueryBuilderDqlRuleTest.php @@ -5,6 +5,7 @@ use PHPStan\Rules\Rule; use PHPStan\Testing\RuleTestCase; use PHPStan\Type\Doctrine\ObjectMetadataResolver; +use const PHP_VERSION_ID; /** * @extends RuleTestCase @@ -22,6 +23,10 @@ protected function getRule(): Rule public function testRule(): void { + if (PHP_VERSION_ID < 70300) { + self::markTestSkipped('For some reason PHP 7.2 cannot recover from Trying to get property value of non-object'); + } + $this->analyse([__DIR__ . '/data/query-builder-dql.php'], [ [ "QueryBuilder: [Syntax Error] line 0, col 66: Error: Expected end of string, got ')'\nDQL: SELECT e FROM PHPStan\Rules\Doctrine\ORM\MyEntity e WHERE e.id = 1)",