|
46 | 46 | use PHPStan\Type\VerbosityLevel; |
47 | 47 | use PHPUnit\Framework\Constraint\IsEqual; |
48 | 48 | use PHPUnit\Framework\Constraint\IsIdentical; |
| 49 | +use Platform\Entity\PlatformRelatedEntity; |
49 | 50 | use Psr\Log\LoggerInterface; |
50 | 51 | use Throwable; |
51 | 52 | use function class_exists; |
@@ -3509,7 +3510,21 @@ public static function provideCases(): iterable |
3509 | 3510 | 'stringify' => self::STRINGIFY_DEFAULT, |
3510 | 3511 | ]; |
3511 | 3512 |
|
3512 | | - // TODO test IDENTITY |
| 3513 | + yield 'IDENTITY(t.related_entity)' => [ |
| 3514 | + 'data' => self::dataDefault(), |
| 3515 | + 'select' => 'SELECT IDENTITY(t.related_entity) FROM %s t', |
| 3516 | + 'mysql' => self::int(), |
| 3517 | + 'sqlite' => self::int(), |
| 3518 | + 'pdo_pgsql' => self::int(), |
| 3519 | + 'pgsql' => self::int(), |
| 3520 | + 'mssql' => self::mixed(), |
| 3521 | + 'mysqlResult' => 1, |
| 3522 | + 'sqliteResult' => 1, |
| 3523 | + 'pdoPgsqlResult' => 1, |
| 3524 | + 'pgsqlResult' => 1, |
| 3525 | + 'mssqlResult' => 1, |
| 3526 | + 'stringify' => self::STRINGIFY_DEFAULT, |
| 3527 | + ]; |
3513 | 3528 | } |
3514 | 3529 |
|
3515 | 3530 | /** |
@@ -3653,8 +3668,14 @@ private function getQuery( |
3653 | 3668 | $schemaTool->dropSchema($classes); |
3654 | 3669 | $schemaTool->createSchema($classes); |
3655 | 3670 |
|
| 3671 | + $relatedEntity = new PlatformRelatedEntity(); |
| 3672 | + $relatedEntity->id = 1; |
| 3673 | + $entityManager->persist($relatedEntity); |
| 3674 | + |
3656 | 3675 | foreach ($data as $rowData) { |
3657 | 3676 | $entity = new PlatformEntity(); |
| 3677 | + $entity->related_entity = $relatedEntity; |
| 3678 | + |
3658 | 3679 | foreach ($rowData as $column => $value) { |
3659 | 3680 | $entity->$column = $value; // @phpstan-ignore-line Intentionally dynamic |
3660 | 3681 | } |
|
0 commit comments