/** * validate that we can interact with the visit process using an eventlistener * * @return void */ public function testThrowsEvent() { $query = 'eq(name,replaceme)&limit(10)'; $dispatcher = new \Symfony\Component\EventDispatcher\EventDispatcher(); $dispatcher->addListener('rql.visit.node', [new \Graviton\Rql\Listener\TestListener(), 'onVisitNode']); $visitor = new MongoOdm(); $visitor->setBuilder($this->builder); $visitor->setDispatcher($dispatcher); $results = $this->runTestQuery($query, $visitor); $this->assertCount(1, $results); $this->assertEquals('My First Sprocket', $results[0]->name); }