/**
  * Hook, called from "BrowserTestCase::run" method.
  *
  * @param TestEndedEvent $event Test ended event.
  *
  * @return void
  */
 public function onTestEnded(TestEndedEvent $event)
 {
     if (!$this->isEventForMe($event)) {
         return;
     }
     parent::onTestEnded($event);
     if ($event->getSession() === null) {
         // Session wasn't used in particular test.
         return;
     }
     $test_case = $event->getTestCase();
     $this->getAPIClient()->updateStatus($this->getSessionId($event->getSession()), $this->getTestStatus($test_case, $event->getTestResult()));
 }
 /**
  * Hook, called from "BrowserTestCase::run" method.
  *
  * @param TestEndedEvent $event Test ended event.
  *
  * @return void
  */
 public function onTestEnded(TestEndedEvent $event)
 {
     if (!$event->validateSubscriber($this->getTestCase())) {
         return;
     }
     parent::onTestEnded($event);
     $session = $event->getSession();
     if ($session === null || !$session->isStarted()) {
         // Session wasn't used in particular test.
         return;
     }
     $test_case = $event->getTestCase();
     $this->getAPIClient()->updateStatus($this->getSessionId($session), $this->getTestStatus($test_case, $event->getTestResult()));
 }