예제 #1
0
 /**
  * @expectedException Exception
  */
 public function testRegistroNaoExistenteLancaExcecao()
 {
     $this->_db->expects($this->once())->method('ProximoRegistro')->will($this->returnValue(FALSE));
     $mapper = new CoreExt_EntityDataMapperStub($this->_db);
     $found = $mapper->find(1);
     $this->assertEquals($expected, $found);
 }
예제 #2
0
 public function testApagaRegistroUsandoInstanciaDeEntity()
 {
     $mapper = new CoreExt_EntityDataMapperStub($this->getDbAdapter());
     $entity = $mapper->find(1);
     $mapper->delete($entity);
     $this->assertTablesEqual($this->createXMLDataSet($this->getFixture('pessoa-depois-removido.xml'))->getTable('pessoa'), $this->getConnection()->createDataSet()->getTable('pessoa'));
 }