File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change 55namespace Doctrine \Tests \ORM \Tools ;
66
77use Doctrine \Common \Collections \Collection ;
8+ use Doctrine \DBAL \Platforms \PostgreSQLPlatform ;
89use Doctrine \ORM \Mapping \ClassMetadata ;
910use Doctrine \ORM \Mapping \Column ;
1011use Doctrine \ORM \Mapping \Entity ;
4445
4546use function count ;
4647use function current ;
48+ use function end ;
4749
4850class SchemaToolTest extends OrmTestCase
4951{
@@ -405,6 +407,10 @@ public function testJoinColumnWithOptions(): void
405407 $ schema = $ schemaTool ->getSchemaFromMetadata ($ classes );
406408
407409 self ::assertSame (['deferrable ' => true , 'deferred ' => true ], $ schema ->getTable ('test ' )->getForeignKey ('FK_D87F7E0C1E5D0459 ' )->getOptions ());
410+
411+ $ sql = $ schema ->toSql (new PostgreSQLPlatform ());
412+
413+ $ this ->assertSame ('ALTER TABLE test ADD CONSTRAINT FK_D87F7E0C1E5D0459 FOREIGN KEY (test_id) REFERENCES test_relation (id) DEFERRABLE INITIALLY DEFERRED ' , end ($ sql ));
408414 }
409415}
410416
@@ -421,6 +427,7 @@ class TestEntityWithJoinColumnWithOptions
421427 private TestEntityWithJoinColumnWithOptionsRelation $ test ;
422428}
423429
430+ #[Table('test_relation ' )]
424431#[Entity]
425432class TestEntityWithJoinColumnWithOptionsRelation
426433{
You can’t perform that action at this time.
0 commit comments