protected function setUp() { parent::setUp(); $this->annotatedTest = new AnnotatedTest(); $this->annotatedTestDao = new AnnotatedTestDao($this->database, $this->daoFactory); $this->annotatedTableData = $this->database->build($this->annotatedTestDao->getEntityClass()); $this->annotatedTestDao->createTable(); }
public function testCanUpdateChildElementWithoutLoosingParentFK() { $this->entity->setOneToManyChild(array(new ChildTest())); $this->annotatedTestDao->create($this->entity); $this->entity = $this->annotatedTestDao->find($this->entity->getId()); $this->assertEquals(1, count($this->entity->getOneToManyChild())); $child = current($this->entity->getOneToManyChild()); $child->setData('something updated'); $this->childTestDao->update($child); $this->annotatedTestDao->refresh($this->entity); $this->assertEquals(1, count($this->entity->getOneToManyChild())); }