diff --git a/tests/Type/Doctrine/Query/QueryResultTypeWalkerTest.php b/tests/Type/Doctrine/Query/QueryResultTypeWalkerTest.php index 73d8098d..7cdefb16 100644 --- a/tests/Type/Doctrine/Query/QueryResultTypeWalkerTest.php +++ b/tests/Type/Doctrine/Query/QueryResultTypeWalkerTest.php @@ -1274,33 +1274,35 @@ public function getTestData(): iterable ', ]; - yield 'locate function' => [ - $this->constantArray([ - [new ConstantIntegerType(1), $this->uintStringified()], - [new ConstantIntegerType(2), TypeCombinator::addNull($this->uintStringified())], - [new ConstantIntegerType(3), TypeCombinator::addNull($this->uintStringified())], - [new ConstantIntegerType(4), $this->uintStringified()], - ]), - ' + if (PHP_VERSION_ID > 70300) { + yield 'locate function' => [ + $this->constantArray([ + [new ConstantIntegerType(1), $this->uintStringified()], + [new ConstantIntegerType(2), TypeCombinator::addNull($this->uintStringified())], + [new ConstantIntegerType(3), TypeCombinator::addNull($this->uintStringified())], + [new ConstantIntegerType(4), $this->uintStringified()], + ]), + ' SELECT LOCATE(m.stringColumn, m.stringColumn, 0), LOCATE(m.stringNullColumn, m.stringColumn, 0), LOCATE(m.stringColumn, m.stringNullColumn, 0), LOCATE(\'f\', \'foo\', 0) FROM QueryResult\Entities\Many m ', - null, - InstalledVersions::satisfies(new VersionParser(), 'doctrine/dbal', '>=3.4') - ? null - : ( + null, + InstalledVersions::satisfies(new VersionParser(), 'doctrine/dbal', '>=3.4') + ? null + : ( PHP_VERSION_ID >= 80100 ? 'strpos(): Passing null to parameter #2 ($needle) of type string is deprecated' : ( - PHP_VERSION_ID >= 70300 && PHP_VERSION_ID < 80000 - ? 'strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior' - : null - ) - ), - ]; + PHP_VERSION_ID >= 70300 && PHP_VERSION_ID < 80000 + ? 'strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior' + : null + ) + ), + ]; + } yield 'lower function' => [ $this->constantArray([