/** * This function intializes the runner. It sets the runId, inits the configuration * and registers the assigned listeners. Afterwards all listeners are notified. If * a listener returns false on notification the runner is not able to run. * * @notify LiveTest.Runner.InitConfig * @notify LiveTest.Runner.Init * * @param array $arguments * @param Dispatcher $dispatcher */ public function __construct($arguments, Dispatcher $dispatcher) { $this->eventDispatcher = $dispatcher; $this->initRunId(); $this->initCoreListener($arguments); parent::__construct($arguments); $this->initConfig(); $this->eventDispatcher->simpleNotify('LiveTest.Runner.InitConfig', array('config' => $this->config)); $this->initListeners(); $event = new Event('LiveTest.Runner.Init', array('arguments' => $arguments)); $this->eventDispatcher->notifyUntil($event); $this->runAllowed = !$event->isProcessed(); }