function test_rollback_entity_before_commit() { $lazyItems = ["foo", "bar", "baz"]; $this->wrapper = $this->createLazyObjectsWrapper($lazyItems); $entity = new EntityFake(1, "Dawid", "Sajdak"); $entityProxy = $this->wrapper->wrap($entity); $this->uow->register($entityProxy); $entityProxy->changeFirstName("Norbert"); $entityProxy->changeLastName("Orzechowicz"); $this->uow->rollback(); $this->assertSame("Dawid", $entityProxy->getFirstName()); $this->assertSame("Sajdak", $entityProxy->getLastName()); $this->assertSame($lazyItems, $entityProxy->getItems()); }
/** * @return void */ public function rollback() { $this->unitOfWork->rollback(); }