コード例 #1
0
    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());
    }
コード例 #2
0
 /**
  * @return void
  */
 public function rollback()
 {
     $this->unitOfWork->rollback();
 }