Esempio n. 1
0
 public function testAddPersistAndClear()
 {
     $this->entityPool->addPersistEntity($fooEntity = $this->createTestEntity());
     $this->entityPool->addPersistEntity($barEntity = $this->createTestEntity());
     $this->entityManager->expects($this->at(0))->method('persist')->with($fooEntity);
     $this->entityManager->expects($this->at(1))->method('persist')->with($barEntity);
     $this->entityManager->expects($this->never())->method('flush');
     $this->entityPool->persistAndClear($this->entityManager);
     $this->assertAttributeEquals(array(), 'persistEntities', $this->entityPool);
 }