public function testGetDeleteSQLOnAnnotatedEntity()
 {
     $this->annotatedTest->setId(1);
     $sql = $this->annotatedTableData->getDeleteSQL($this->annotatedTest);
     $this->assertEqualsFixture($sql, __FUNCTION__);
     $this->runQuery($sql);
 }
Ejemplo n.º 2
0
 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()));
 }