Example #1
0
 public function testAlternativeSyntaxOfUsFilters2()
 {
     $data = array('ref' => '/article/123/12121432', 'event' => 'update', 'tag' => array('article', 'article/123'));
     $id = Edo_Event_Factory::create($data);
     $event = $this->engine->findEventById($id, 'manager');
     $worker = new Edo_Event_Worker_Manager($this->test_config);
     $this->assertTrue($worker->processEvent($event));
     $base = TESTS_ROOT . "/data";
     $files = glob("{$base}" . DIRECTORY_SEPARATOR . "*" . DIRECTORY_SEPARATOR . "pool" . DIRECTORY_SEPARATOR . "event_*");
     $this->assertTrue(count($files) == 3);
 }
Example #2
0
 public function processEvent(Edo_Event $event)
 {
     $this->_loadFilters();
     foreach ($this->filters as $worker_name => $filter) {
         if ($this->hasMatch($filter, $event)) {
             $newEvent = clone $event;
             Edo_Event_Factory::create($newEvent, $worker_name);
         } else {
             $e = var_export($event->toArray(), 1);
             $f = var_export($filter, 1);
             //                $this->log("No match for filter $f  event $e");
         }
     }
     return true;
 }
Example #3
0
 public function testWrongInputCreatesExceptionCreatesDefaultEngine()
 {
     $this->setExpectedException('Edo_Event_Engine_Exception');
     Edo_Event_Engine::setDefaultEngine(null);
     $id = Edo_Event_Factory::create('moooo', 'manager', $this->engine, true);
 }