You are here

public function DrupalStandardsListener::endTest in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/tests/Drupal/Tests/Listeners/DrupalStandardsListener.php \Drupal\Tests\Listeners\DrupalStandardsListener::endTest()

File

core/tests/Drupal/Tests/Listeners/DrupalStandardsListener.php, line 149
Contains \Drupal\Tests\Listeners\DrupalStandardsListener.

Class

DrupalStandardsListener
Listens for PHPUnit tests and fails those with invalid coverage annotations.

Namespace

Drupal\Tests\Listeners

Code

public function endTest(\PHPUnit_Framework_Test $test, $time) {

  // \PHPUnit_Framework_Test does not have any useful methods of its own for
  // our purpose, so we have to distinguish between the different known
  // subclasses.
  if ($test instanceof \PHPUnit_Framework_TestCase) {
    $this
      ->checkValidCoversForTest($test);
  }
  elseif ($test instanceof \PHPUnit_Framework_TestSuite) {
    foreach ($test
      ->getGroupDetails() as $tests) {
      foreach ($tests as $test) {
        $this
          ->endTest($test, $time);
      }
    }
  }
}