Skip to content

Commit 231392d

Browse files
committed
Skip tests not working on ORM 3
Related: doctrine/orm#11240
1 parent e56223f commit 231392d

File tree

1 file changed

+23
-18
lines changed

1 file changed

+23
-18
lines changed

tests/Type/Doctrine/Query/QueryResultTypeWalkerTest.php

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
use function count;
5050
use function property_exists;
5151
use function sprintf;
52+
use function strpos;
5253
use function version_compare;
5354
use const PHP_VERSION_ID;
5455

@@ -1176,37 +1177,41 @@ public function getTestData(): iterable
11761177
',
11771178
];
11781179

1179-
yield 'date_add function' => [
1180-
$this->constantArray([
1181-
[new ConstantIntegerType(1), new StringType()],
1182-
[new ConstantIntegerType(2), TypeCombinator::addNull(new StringType())],
1183-
[new ConstantIntegerType(3), TypeCombinator::addNull(new StringType())],
1184-
[new ConstantIntegerType(4), new StringType()],
1185-
]),
1186-
'
1180+
$ormVersion = InstalledVersions::getVersion('doctrine/orm');
1181+
$hasOrm3 = strpos($ormVersion, '3.0') === 0;
1182+
if (!$hasOrm3) {
1183+
yield 'date_add function' => [
1184+
$this->constantArray([
1185+
[new ConstantIntegerType(1), new StringType()],
1186+
[new ConstantIntegerType(2), TypeCombinator::addNull(new StringType())],
1187+
[new ConstantIntegerType(3), TypeCombinator::addNull(new StringType())],
1188+
[new ConstantIntegerType(4), new StringType()],
1189+
]),
1190+
'
11871191
SELECT DATE_ADD(m.datetimeColumn, m.intColumn, \'day\'),
11881192
DATE_ADD(m.stringNullColumn, m.intColumn, \'day\'),
11891193
DATE_ADD(m.datetimeColumn, NULLIF(m.intColumn, 1), \'day\'),
11901194
DATE_ADD(\'2020-01-01\', 7, \'day\')
11911195
FROM QueryResult\Entities\Many m
11921196
',
1193-
];
1197+
];
11941198

1195-
yield 'date_sub function' => [
1196-
$this->constantArray([
1197-
[new ConstantIntegerType(1), new StringType()],
1198-
[new ConstantIntegerType(2), TypeCombinator::addNull(new StringType())],
1199-
[new ConstantIntegerType(3), TypeCombinator::addNull(new StringType())],
1200-
[new ConstantIntegerType(4), new StringType()],
1201-
]),
1202-
'
1199+
yield 'date_sub function' => [
1200+
$this->constantArray([
1201+
[new ConstantIntegerType(1), new StringType()],
1202+
[new ConstantIntegerType(2), TypeCombinator::addNull(new StringType())],
1203+
[new ConstantIntegerType(3), TypeCombinator::addNull(new StringType())],
1204+
[new ConstantIntegerType(4), new StringType()],
1205+
]),
1206+
'
12031207
SELECT DATE_SUB(m.datetimeColumn, m.intColumn, \'day\'),
12041208
DATE_SUB(m.stringNullColumn, m.intColumn, \'day\'),
12051209
DATE_SUB(m.datetimeColumn, NULLIF(m.intColumn, 1), \'day\'),
12061210
DATE_SUB(\'2020-01-01\', 7, \'day\')
12071211
FROM QueryResult\Entities\Many m
12081212
',
1209-
];
1213+
];
1214+
}
12101215

12111216
yield 'date_diff function' => [
12121217
$this->constantArray([

0 commit comments

Comments
 (0)