File tree Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change @@ -391,6 +391,42 @@ public function testLoadUniqueConstraintWithoutName(): void
391391 self ::assertTrue ($ tableIndex ->isUnique ());
392392 self ::assertSame (['field ' , 'anotherField ' ], $ tableIndex ->getColumns ());
393393 }
394+
395+ public function testJoinColumnWithOptions (): void
396+ {
397+ $ em = $ this ->getTestEntityManager ();
398+ $ schemaTool = new SchemaTool ($ em );
399+
400+ $ classes = [
401+ $ em ->getClassMetadata (TestEntityWithJoinColumnWithOptions::class),
402+ $ em ->getClassMetadata (TestEntityWithJoinColumnWithOptionsRelation::class),
403+ ];
404+
405+ $ schema = $ schemaTool ->getSchemaFromMetadata ($ classes );
406+
407+ self ::assertSame (['deferrable ' => true , 'deferred ' => true ], $ schema ->getTable ('test ' )->getForeignKey ('FK_D87F7E0C1E5D0459 ' )->getOptions ());
408+ }
409+ }
410+
411+ #[Table('test ' )]
412+ #[Entity]
413+ class TestEntityWithJoinColumnWithOptions
414+ {
415+ #[Id]
416+ #[Column]
417+ private int $ id ;
418+
419+ #[OneToOne(targetEntity: TestEntityWithJoinColumnWithOptionsRelation::class)]
420+ #[JoinColumn(options: ['deferrable ' => true , 'deferred ' => true ])]
421+ private TestEntityWithJoinColumnWithOptionsRelation $ test ;
422+ }
423+
424+ #[Entity]
425+ class TestEntityWithJoinColumnWithOptionsRelation
426+ {
427+ #[Id]
428+ #[Column]
429+ private int $ id ;
394430}
395431
396432#[Table(options: ['foo ' => 'bar ' , 'baz ' => ['key ' => 'val ' ]])]
You can’t perform that action at this time.
0 commit comments