|
59 | 59 | use TheCodingMachine\TDBM\Test\Dao\Bean\Generated\FileBaseBean;
|
60 | 60 | use TheCodingMachine\TDBM\Test\Dao\Bean\Generated\UserBaseBean;
|
61 | 61 | use TheCodingMachine\TDBM\Test\Dao\Bean\NodeBean;
|
| 62 | +use TheCodingMachine\TDBM\Test\Dao\Bean\ObjectBaseBean; |
| 63 | +use TheCodingMachine\TDBM\Test\Dao\Bean\ObjectInheritedBean; |
62 | 64 | use TheCodingMachine\TDBM\Test\Dao\Bean\PersonBean;
|
63 | 65 | use TheCodingMachine\TDBM\Test\Dao\Bean\RefNoPrimKeyBean;
|
64 | 66 | use TheCodingMachine\TDBM\Test\Dao\Bean\RoleBean;
|
|
74 | 76 | use TheCodingMachine\TDBM\Test\Dao\Generated\ContactBaseDao;
|
75 | 77 | use TheCodingMachine\TDBM\Test\Dao\Generated\UserBaseDao;
|
76 | 78 | use TheCodingMachine\TDBM\Test\Dao\NodeDao;
|
| 79 | +use TheCodingMachine\TDBM\Test\Dao\ObjectBaseDao; |
| 80 | +use TheCodingMachine\TDBM\Test\Dao\ObjectInheritedDao; |
77 | 81 | use TheCodingMachine\TDBM\Test\Dao\RefNoPrimKeyDao;
|
78 | 82 | use TheCodingMachine\TDBM\Test\Dao\RoleDao;
|
79 | 83 | use TheCodingMachine\TDBM\Test\Dao\StateDao;
|
@@ -2074,4 +2078,16 @@ public function testLazyLoad(): void
|
2074 | 2078 | $roleBean->getId();
|
2075 | 2079 | $this->assertSame(TDBMObjectStateEnum::STATE_NOT_LOADED, $roleBean->_getDbRows()['roles']->_getStatus());
|
2076 | 2080 | }
|
| 2081 | + |
| 2082 | + public function testOneToOneInverseRelationGetter(): void |
| 2083 | + { |
| 2084 | + $objectBaseDao = new ObjectBaseDao($this->tdbmService); |
| 2085 | + $objectInheritedDao = new ObjectInheritedDao($this->tdbmService); |
| 2086 | + $objectBase = new ObjectBaseBean(); |
| 2087 | + $objectBaseDao->save($objectBase); |
| 2088 | + $this->assertNull($objectBase->getObjectInherited()); |
| 2089 | + $objectInherited = new ObjectInheritedBean($objectBase); |
| 2090 | + $objectInheritedDao->save($objectInherited); |
| 2091 | + $this->assertInstanceOf(ObjectInheritedBean::class, $objectBase->getObjectInherited()); |
| 2092 | + } |
2077 | 2093 | }
|
0 commit comments