public function testCommitException() { $author = new Author(array('id' => 1, 'name' => "Jakub Vrana", 'web' => "http://www.vrana.cz/")); $this->object->registerSave($author); $this->object->registerSave($author); $this->setExpectedException('InvalidStateException'); $this->object->commit(); }
/** * Get unit of work * * @return ActiveMapper\UnitOfWork */ public function getUnitOfWork() { if (!isset($this->unitOfWork)) { $this->unitOfWork = UnitOfWork::getUnitOfWork($this); } return $this->unitOfWork; }
public function testGetUnitOfWork() { $data = new UnitOfWork($this->manager); $this->assertEquals($data, UnitOfWork::getUnitOfWork($this->manager)); }