class DrupalListener

Same name in this branch
  1. 8.9.x core/tests/Drupal/TestTools/PhpUnitCompatibility/PhpUnit7/DrupalListener.php \Drupal\TestTools\PhpUnitCompatibility\PhpUnit7\DrupalListener
Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Listeners/DrupalListener.php \Drupal\Tests\Listeners\DrupalListener
  2. 10 core/tests/Drupal/Tests/Listeners/DrupalListener.php \Drupal\Tests\Listeners\DrupalListener
  3. 11.x core/tests/Drupal/Tests/Listeners/DrupalListener.php \Drupal\Tests\Listeners\DrupalListener

Listens to PHPUnit test runs.

@internal

Hierarchy

Expanded class hierarchy of DrupalListener

File

core/tests/Drupal/TestTools/PhpUnitCompatibility/PhpUnit6/DrupalListener.php, line 17

Namespace

Drupal\TestTools\PhpUnitCompatibility\PhpUnit6
View source
class DrupalListener implements TestListener {
    use TestListenerDefaultImplementation;
    use DeprecationListenerTrait;
    use DrupalComponentTestListenerTrait;
    use DrupalStandardsListenerTrait;
    
    /**
     * {@inheritdoc}
     */
    public function startTest(Test $test) {
        $this->deprecationStartTest($test);
    }
    
    /**
     * {@inheritdoc}
     */
    public function endTest(Test $test, $time) {
        $this->deprecationEndTest($test, $time);
        $this->componentEndTest($test, $time);
        $this->standardsEndTest($test, $time);
    }

}

Members

Title Sort descending Deprecated Modifiers Object type Summary
DeprecationListenerTrait::$previousHandler private property The previous error handler.
DeprecationListenerTrait::deprecationEndTest protected function Reacts to the end of a test.
DeprecationListenerTrait::deprecationStartTest protected function
DeprecationListenerTrait::getSkippedDeprecations public static function A list of deprecations to ignore whilst fixes are put in place.
DeprecationListenerTrait::registerErrorHandler protected function Registers an error handler that wraps Symfony's DeprecationErrorHandler.
DeprecationListenerTrait::willBeIsolated private function Determines if a test is isolated.
DrupalComponentTestListenerTrait::componentEndTest protected function Reacts to the end of a test.
DrupalListener::endTest public function
DrupalListener::startTest public function
DrupalStandardsListenerTrait::checkValidCoversForTest private function Check an individual test run for valid @covers annotation.
DrupalStandardsListenerTrait::classExists private function Helper method to check if a string names a valid class or trait.
DrupalStandardsListenerTrait::doEndTest private function Reacts to the end of a test.
DrupalStandardsListenerTrait::errorHandler public static function Handles errors to ensure deprecation messages are not triggered.
DrupalStandardsListenerTrait::fail private function Signals a coding standards failure to the user.
DrupalStandardsListenerTrait::isTestSuite private function Determine if a test object is a test suite regardless of PHPUnit version.
DrupalStandardsListenerTrait::standardsEndTest protected function Reacts to the end of a test.
ExpectDeprecationTrait::addExpectedDeprecationMessage protected function Sets an expected deprecation message.
ExpectDeprecationTrait::expectDeprecation Deprecated protected function Sets an expected deprecation message.
ExpectDeprecationTrait::expectedDeprecations public function Sets expected deprecation messages.
ExpectDeprecationTrait::getSymfonyTestListenerTrait private function Gets the SymfonyTestsListenerTrait.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.