public function testUpdate() { $this->em->expects($this->once())->method('getRepository')->with($this->equalTo('Newscoop\\Entity\\Events\\CommunityTickerEvent'))->will($this->returnValue($this->repository)); $this->em->expects($this->once())->method('flush')->with(); $this->repository->expects($this->once())->method('save')->with(); $event = new GenericEvent($this, array('user' => 1, 'params' => array('title' => 'Test'))); $event->setName('event.test'); $this->service->update($event); }
public function testUpdate() { $this->repository->expects($this->once())->method('save')->with($this->isInstanceOf('Newscoop\\Entity\\AuditEvent'), $this->contains('test')); $this->em->expects($this->once())->method('getRepository')->with($this->equalTo('Newscoop\\Entity\\AuditEvent'))->will($this->returnValue($this->repository)); $this->em->expects($this->once())->method('flush')->with(); $event = new GenericEvent($this); $event->setName('event.test'); $this->service->update($event); }