Skip to content

Commit 4b66f5c

Browse files
committed
Fix
1 parent 776038d commit 4b66f5c

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

tests/Rules/Doctrine/ORM/QueryBuilderDqlRuleSlowTest.php

+4
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use PHPStan\Rules\Rule;
66
use PHPStan\Testing\RuleTestCase;
77
use PHPStan\Type\Doctrine\ObjectMetadataResolver;
8+
use const PHP_VERSION_ID;
89

910
/**
1011
* @extends RuleTestCase<QueryBuilderDqlRule>
@@ -22,6 +23,9 @@ protected function getRule(): Rule
2223

2324
public function testRule(): void
2425
{
26+
if (PHP_VERSION_ID < 70300) {
27+
self::markTestSkipped('For some reason PHP 7.2 cannot recover from Trying to get property value of non-object');
28+
}
2529
$this->analyse([__DIR__ . '/data/query-builder-dql.php'], [
2630
[
2731
"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)",

tests/Rules/Doctrine/ORM/QueryBuilderDqlRuleTest.php

+5
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use PHPStan\Rules\Rule;
66
use PHPStan\Testing\RuleTestCase;
77
use PHPStan\Type\Doctrine\ObjectMetadataResolver;
8+
use const PHP_VERSION_ID;
89

910
/**
1011
* @extends RuleTestCase<QueryBuilderDqlRule>
@@ -22,6 +23,10 @@ protected function getRule(): Rule
2223

2324
public function testRule(): void
2425
{
26+
if (PHP_VERSION_ID < 70300) {
27+
self::markTestSkipped('For some reason PHP 7.2 cannot recover from Trying to get property value of non-object');
28+
}
29+
2530
$this->analyse([__DIR__ . '/data/query-builder-dql.php'], [
2631
[
2732
"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)",

0 commit comments

Comments
 (0)