public function onReject(VersioningEvent $e) { $repositoryManager = $e->getRepositoryManager(); $repository = $e->getRepository(); $revision = $e->getRevision(); $data = $e->getData(); $message = $e->getMessage(); $identity = $e->getIdentity(); // ... }
public function testGetters() { $repositoryManager = $this->getMock('Athene2\\Versioning\\Manager\\RepositoryManager', [], [], '', false); $repository = $this->getMock('Athene2\\Versioning\\Entity\\RepositoryInterface'); $revision = $this->getMock('Athene2\\Versioning\\Entity\\RevisionInterface'); $identity = $this->getMock('ZfcRbac\\Identity\\IdentityInterface'); $message = 'foobar'; $data = ['foo' => 'bar']; $event = new VersioningEvent($repository, $revision, $repositoryManager, $message, $data, $identity); $this->assertSame($identity, $event->getIdentity()); $this->assertSame($repository, $event->getRepository()); $this->assertSame($revision, $event->getRevision()); $this->assertSame($repositoryManager, $event->getRepositoryManager()); $this->assertEquals($message, $event->getMessage()); $this->assertEquals($data, $event->getData()); }
public function eventHydrationCallbackTest(VersioningEvent $event) { $this->assertInstanceOf('ZfcRbac\\Identity\\IdentityInterface', $event->getIdentity()); $this->assertInstanceOf('Athene2\\Versioning\\Entity\\RevisionInterface', $event->getRevision()); $this->assertInstanceOf('Athene2\\Versioning\\Entity\\RepositoryInterface', $event->getRepository()); $this->assertSame('foo', $event->getMessage()); $this->eventCalled = true; }