public function testAtualizaRegistroComChaveComposta() { $mapper = new CoreExt_EntityCompoundDataMapperStub($this->getDbAdapter()); $entity = new CoreExt_EntityCompoundStub(array('pessoa' => 1, 'curso' => 2, 'confirmado' => TRUE)); // Marca como se tivesse sido carregado, para forçar CoreExt_DataMapper // a usar o INSERT. $entity->markOld(); $mapper->save($entity); $this->assertTablesEqual($this->createXMLDataSet($this->getFixture('matricula-depois-atualizado.xml'))->getTable('matricula'), $this->getConnection()->createDataSet()->getTable('matricula')); }
public function testAtualizaRegistroComChaveComposta() { $this->_db->expects($this->once())->method('Consulta')->will($this->returnValue(TRUE)); $entity = new CoreExt_EntityCompoundStub(); $entity->pessoa = 1; $entity->curso = 1; $entity->confirmado = TRUE; $mapper = new CoreExt_EntityCompoundDataMapperStub($this->_db); $this->assertTrue($mapper->save($entity)); }