public function setUp()
 {
     $this->listener = new DoctrineListener();
     $this->eventDispatcher = $this->getMock('Symfony\\Component\\EventDispatcher\\EventDispatcherInterface');
     $this->listener->setEventDispatcher($this->eventDispatcher);
     $this->assertEquals($this->eventDispatcher, $this->listener->getEventDispatcher());
 }
Esempio n. 2
0
 public function testPostFlush()
 {
     $args = $this->getMockBuilder('Doctrine\\ORM\\Event\\PostFlushEventArgs')->disableOriginalConstructor()->getMock();
     $entityManager = $this->getMockBuilder('Doctrine\\ORM\\EntityManager')->disableOriginalConstructor()->getMock();
     $args->expects($this->once())->method('getEntityManager')->will($this->returnValue($entityManager));
     $this->entityPool->expects($this->once())->method('persistAndFlush')->with($entityManager);
     $this->listener->postFlush($args);
 }