private function getEventData(EventDataCollector $collector)
 {
     $data = array('called' => array(), 'not_called' => array());
     foreach ($collector->getCalledListeners() as $key => $listener) {
         if (!$this->isNamespaceWhitelisted($listener['class'])) {
             $listener['class'] = 'XXX';
         }
         $data['called'][] = $listener;
     }
     foreach ($collector->getNotCalledListeners() as $key => $listener) {
         if (!$this->isNamespaceWhitelisted($listener['class'])) {
             $listener['class'] = 'XXX';
         }
         $data['not_called'][] = $listener;
     }
     return $data;
 }
Ejemplo n.º 2
0
 public function testCollect()
 {
     $c = new EventDataCollector();
     $c->setEventDispatcher(new TestEventDispatcher());
     $c->collect(new Request(), new Response());
     $this->assertSame('events', $c->getName());
     $this->assertSame(array('foo'), $c->getCalledListeners());
     $this->assertSame(array('bar'), $c->getNotCalledListeners());
 }