Esempio n. 1
0
 public function testAtualizaRegistro()
 {
     $this->_db->expects($this->once())->method('Consulta')->will($this->returnValue(TRUE));
     $entity = new CoreExt_EntityStub();
     $entity->id = 1;
     $entity->nome = 'Fernando Nascimento';
     $entity->estadoCivil = 'casado';
     $mapper = new CoreExt_EntityDataMapperStub($this->_db);
     $this->assertTrue($mapper->save($entity));
 }
Esempio n. 2
0
 public function testAtualizaRegistro()
 {
     $mapper = new CoreExt_EntityDataMapperStub($this->getDbAdapter());
     $entity = $mapper->find(2);
     $entity->estadoCivil = 'solteiro';
     $entity->doador = '';
     $mapper->save($entity);
     $this->assertTablesEqual($this->createXMLDataSet($this->getFixture('pessoa-depois-atualizado.xml'))->getTable('pessoa'), $this->getConnection()->createDataSet()->getTable('pessoa'));
 }