@@ -239,6 +239,12 @@ public function test(Type $expectedType, string $dql, ?string $expectedException
239
239
*/
240
240
public function getTestData (): iterable
241
241
{
242
+ $ ormVersion = InstalledVersions::getVersion ('doctrine/orm ' );
243
+ $ hasOrm3 = strpos ($ ormVersion , '3. ' ) === 0 ;
244
+
245
+ $ dbalVersion = InstalledVersions::getVersion ('doctrine/dbal ' );
246
+ $ hasDbal4 = strpos ($ dbalVersion , '4. ' ) === 0 ;
247
+
242
248
yield 'just root entity ' => [
243
249
new ObjectType (One::class),
244
250
'
@@ -355,7 +361,7 @@ public function getTestData(): iterable
355
361
]),
356
362
$ this ->constantArray ([
357
363
[new ConstantIntegerType (0 ), new ObjectType (One::class)],
358
- [new ConstantStringType ('id ' ), $ this ->numericString ()],
364
+ [new ConstantStringType ('id ' ), $ hasDbal4 ? new IntegerType () : $ this ->numericString ()],
359
365
[new ConstantStringType ('intColumn ' ), new IntegerType ()],
360
366
])
361
367
),
@@ -377,7 +383,7 @@ public function getTestData(): iterable
377
383
]),
378
384
$ this ->constantArray ([
379
385
[new ConstantIntegerType (0 ), new ObjectType (Many::class)],
380
- [new ConstantStringType ('id ' ), $ this ->numericString ()],
386
+ [new ConstantStringType ('id ' ), $ hasDbal4 ? new IntegerType () : $ this ->numericString ()],
381
387
[new ConstantStringType ('intColumn ' ), new IntegerType ()],
382
388
])
383
389
),
@@ -398,7 +404,7 @@ public function getTestData(): iterable
398
404
]),
399
405
$ this ->constantArray ([
400
406
[new ConstantStringType ('one ' ), new ObjectType (One::class)],
401
- [new ConstantStringType ('id ' ), $ this ->numericString ()],
407
+ [new ConstantStringType ('id ' ), $ hasDbal4 ? new IntegerType () : $ this ->numericString ()],
402
408
[new ConstantStringType ('intColumn ' ), new IntegerType ()],
403
409
])
404
410
),
@@ -508,7 +514,7 @@ public function getTestData(): iterable
508
514
yield 'just root entity and scalars ' => [
509
515
$ this ->constantArray ([
510
516
[new ConstantIntegerType (0 ), new ObjectType (One::class)],
511
- [new ConstantStringType ('id ' ), $ this ->numericString ()],
517
+ [new ConstantStringType ('id ' ), $ hasDbal4 ? new IntegerType () : $ this ->numericString ()],
512
518
]),
513
519
'
514
520
SELECT o, o.id
@@ -1177,8 +1183,6 @@ public function getTestData(): iterable
1177
1183
' ,
1178
1184
];
1179
1185
1180
- $ ormVersion = InstalledVersions::getVersion ('doctrine/orm ' );
1181
- $ hasOrm3 = strpos ($ ormVersion , '3.0 ' ) === 0 ;
1182
1186
if (!$ hasOrm3 ) {
1183
1187
yield 'date_add function ' => [
1184
1188
$ this ->constantArray ([
0 commit comments