Esempio n. 1
0
 public function testAddPersistAndFlush()
 {
     $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->at(2))->method('flush');
     $this->entityPool->persistAndFlush($this->entityManager);
     $this->assertAttributeEquals(array(), 'persistEntities', $this->entityPool);
 }