示例#1
0
 /**
  * @param PluginInterface $plugin
  * @param string $eventSetting
  */
 protected function dispatchPluginEvent(PluginInterface $plugin, $eventSetting)
 {
     $events = $plugin->getSetting($eventSetting);
     if (TRUE === is_array($events)) {
         $plugins = $this->loadPluginInstances($events);
         foreach ($plugins as $eventPlugin) {
             $error = $this->executePlugin($eventPlugin, FALSE);
             if (TRUE === $error instanceof \RuntimeException) {
                 $this->response->addOutputFromPlugin($plugin, array('Event error: ' . $eventSetting));
                 $this->response->addOutputFromPlugin($plugin, array($error->getMessage()));
             }
         }
     }
 }
示例#2
0
 public function testGetOutputReturnsArray()
 {
     $response = new Response();
     $result = $response->getOutput();
     $this->assertEquals(array(), $result);
 }