public function testEventHydration() { $this->eventManager = new EventManager(); $this->authorizationService->expects($this->any())->method('getIdentity')->will($this->returnValue($this->identity)); $this->authorizationService->expects($this->any())->method('isGranted')->will($this->returnValue(true)); $this->eventManager->attach(VersioningEvent::COMMIT, [$this, 'eventHydrationCallbackTest']); $this->eventManager->attach(VersioningEvent::REJECT, [$this, 'eventHydrationCallbackTest']); $this->eventManager->attach(VersioningEvent::CHECKOUT, [$this, 'eventHydrationCallbackTest']); $this->repositoryManager->setEventManager($this->eventManager); $this->repositoryManager->commitRevision($this->repository, [], 'foo'); $this->assertTrue($this->eventCalled); $this->eventCalled = false; $this->repositoryManager->checkoutRevision($this->repository, $this->revision, 'foo'); $this->assertTrue($this->eventCalled); $this->eventCalled = false; $this->repositoryManager->rejectRevision($this->repository, $this->revision, 'foo'); $this->assertTrue($this->eventCalled); $this->eventCalled = false; }