Example #1
0
 /**
  * {@inheritdoc}
  */
 public function start($callback = null)
 {
     $event = new Event\BehatPrepareEvent($this->behat, $this, $this->command);
     $dispatcher = $this->behat->getDispatcher();
     $dispatcher->dispatch(Event\BehatEvents::BEHAT_PREPARE, $event);
     $this->prepare($this->behat, $this->command, $this->cwd);
     parent::start($callback);
 }
 /**
  * Adds the test listener for all events, returns the listener.
  *
  * @return \BehatWrapper\Test\Event\TestListener
  */
 public function addListener()
 {
     $dispatcher = $this->wrapper->getDispatcher();
     $listener = new TestListener();
     $dispatcher->addListener(BehatEvents::BEHAT_PREPARE, array($listener, 'onPrepare'));
     $dispatcher->addListener(BehatEvents::BEHAT_SUCCESS, array($listener, 'onSuccess'));
     $dispatcher->addListener(BehatEvents::BEHAT_ERROR, array($listener, 'onError'));
     return $listener;
 }