|
36 | 36 | use PHPStan\Type\Type; |
37 | 37 | use PHPStan\Type\TypeCombinator; |
38 | 38 | use PHPStan\Type\VerbosityLevel; |
| 39 | +use QueryResult\Entities\Dbal4Entity; |
39 | 40 | use QueryResult\Entities\Embedded; |
40 | 41 | use QueryResult\Entities\JoinedChild; |
41 | 42 | use QueryResult\Entities\Many; |
@@ -187,6 +188,15 @@ public static function setUpBeforeClass(): void |
187 | 188 | $em->persist($entityWithEnum); |
188 | 189 | } |
189 | 190 |
|
| 191 | + if (InstalledVersions::satisfies(new VersionParser(), 'doctrine/dbal', '>=4.2')) { |
| 192 | + assert(class_exists(Dbal4Entity::class)); |
| 193 | + |
| 194 | + $dbal4Entity = new Dbal4Entity(); |
| 195 | + $dbal4Entity->enum = 'a'; |
| 196 | + $dbal4Entity->smallfloat = 1.1; |
| 197 | + $em->persist($dbal4Entity); |
| 198 | + } |
| 199 | + |
190 | 200 | $em->flush(); |
191 | 201 | } |
192 | 202 |
|
@@ -1532,6 +1542,25 @@ private function yieldConditionalDataset(): iterable |
1532 | 1542 | ]; |
1533 | 1543 | } |
1534 | 1544 |
|
| 1545 | + if (InstalledVersions::satisfies(new VersionParser(), 'doctrine/dbal', '>=4.2')) { |
| 1546 | + yield 'enum and smallfloat' => [ |
| 1547 | + $this->constantArray([ |
| 1548 | + [ |
| 1549 | + new ConstantStringType('enum'), |
| 1550 | + new StringType(), |
| 1551 | + ], |
| 1552 | + [ |
| 1553 | + new ConstantStringType('smallfloat'), |
| 1554 | + new FloatType(), |
| 1555 | + ], |
| 1556 | + ]), |
| 1557 | + ' |
| 1558 | + SELECT e.enum, e.smallfloat |
| 1559 | + FROM QueryResult\Entities\Dbal4Entity e |
| 1560 | + ', |
| 1561 | + ]; |
| 1562 | + } |
| 1563 | + |
1535 | 1564 | $ormVersion = InstalledVersions::getVersion('doctrine/orm'); |
1536 | 1565 | $hasOrm3 = $ormVersion !== null && strpos($ormVersion, '3.') === 0; |
1537 | 1566 |
|
|
0 commit comments