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

Breadcrumb

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

function Test::isTestMethod

Same name in this branch
  1. 11.1.x vendor/phpunit/phpunit/src/Event/Value/Test/Test.php \PHPUnit\Event\Code\Test::isTestMethod()
2 calls to Test::isTestMethod()
TestCase::isCallableTestMethod in vendor/phpunit/phpunit/src/Framework/TestCase.php
TestSuite::fromClassReflector in vendor/phpunit/phpunit/src/Framework/TestSuite.php

File

vendor/phpunit/phpunit/src/Util/Test.php, line 23

Class

Test
@no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit

Namespace

PHPUnit\Util

Code

public static function isTestMethod(ReflectionMethod $method) : bool {
    if (!$method->isPublic()) {
        return false;
    }
    if (str_starts_with($method->getName(), 'test')) {
        return true;
    }
    $metadata = Registry::parser()->forMethod($method->getDeclaringClass()
        ->getName(), $method->getName());
    return $metadata->isTest()
        ->isNotEmpty();
}
RSS feed
Powered by Drupal