Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. TestSuite.php

function TestSuite::invokeMethodsAfterLastTest

1 call to TestSuite::invokeMethodsAfterLastTest()
TestSuite::run in vendor/phpunit/phpunit/src/Framework/TestSuite.php

File

vendor/phpunit/phpunit/src/Framework/TestSuite.php, line 675

Class

TestSuite
@template-implements IteratorAggregate<int, Test>

Namespace

PHPUnit\Framework

Code

private function invokeMethodsAfterLastTest(Event\Emitter $emitter) : void {
    if (!$this->isForTestClass()) {
        return;
    }
    $methodsCalledAfterLastTest = [];
    $afterClassMethods = (new HookMethods())->hookMethods($this->name)['afterClass'];
    foreach ($afterClassMethods as $afterClassMethod) {
        if ($this->methodDoesNotExistOrIsDeclaredInTestCase($afterClassMethod)) {
            continue;
        }
        try {
            call_user_func([
                $this->name,
                $afterClassMethod,
            ]);
            $methodCalledAfterLastTest = new Event\Code\ClassMethod($this->name, $afterClassMethod);
            $emitter->testAfterLastTestMethodCalled($this->name, $methodCalledAfterLastTest);
            $methodsCalledAfterLastTest[] = $methodCalledAfterLastTest;
        } catch (Throwable) {
            // @todo
        }
    }
    if (!empty($methodsCalledAfterLastTest)) {
        $emitter->testAfterLastTestMethodFinished($this->name, ...$methodsCalledAfterLastTest);
    }
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal