_eventManager = $eventManager ?: self::$_defaultEventManager; if (!$this->_eventManager) { throw new \Magento\Framework\Exception\LocalizedException(__('Instance of the event manager is required.')); } } /** * {@inheritdoc} * @SuppressWarnings(PHPMD.ShortVariable) * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function addError(\PHPUnit_Framework_Test $test, \Exception $e, $time) { } /** * {@inheritdoc} * @SuppressWarnings(PHPMD.ShortVariable) * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function addFailure(\PHPUnit_Framework_Test $test, \PHPUnit_Framework_AssertionFailedError $e, $time) { } /** * {@inheritdoc} * @SuppressWarnings(PHPMD.ShortVariable) * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function addIncompleteTest(\PHPUnit_Framework_Test $test, \Exception $e, $time) { } /** * {@inheritdoc} * @SuppressWarnings(PHPMD.ShortVariable) * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function addRiskyTest(\PHPUnit_Framework_Test $test, \Exception $e, $time) { } /** * {@inheritdoc} * @SuppressWarnings(PHPMD.ShortVariable) * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function addSkippedTest(\PHPUnit_Framework_Test $test, \Exception $e, $time) { } /** * {@inheritdoc} */ public function startTestSuite(\PHPUnit_Framework_TestSuite $suite) { /* PHPUnit runs tests with data provider in own test suite for each test, so just skip such test suites */ if ($suite instanceof \PHPUnit_Framework_TestSuite_DataProvider) { return; } $this->_eventManager->fireEvent('startTestSuite'); } /** * {@inheritdoc} */ public function endTestSuite(\PHPUnit_Framework_TestSuite $suite) { if ($suite instanceof \PHPUnit_Framework_TestSuite_DataProvider) { return; } $this->_eventManager->fireEvent('endTestSuite', [$suite], true); } /** * {@inheritdoc} */ public function startTest(\PHPUnit_Framework_Test $test) { if (!$test instanceof \PHPUnit_Framework_TestCase || $test instanceof \PHPUnit_Framework_Warning) { return; } $this->_eventManager->fireEvent('startTest', [$test]); } /** * {@inheritdoc} * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function endTest(\PHPUnit_Framework_Test $test, $time) { if (!$test instanceof \PHPUnit_Framework_TestCase || $test instanceof \PHPUnit_Framework_Warning) { return; } $this->_eventManager->fireEvent('endTest', [$test], true); } }