You are here

public static function PHPUnit_Framework_TestSuite::isTestMethod in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/phpunit/phpunit/src/Framework/TestSuite.php \PHPUnit_Framework_TestSuite::isTestMethod()

Parameters

ReflectionMethod $method:

Return value

bool

1 call to PHPUnit_Framework_TestSuite::isTestMethod()
PHPUnit_Framework_TestSuite::addTestMethod in vendor/phpunit/phpunit/src/Framework/TestSuite.php

File

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

Class

PHPUnit_Framework_TestSuite
A TestSuite is a composite of Tests. It runs a collection of test cases.

Code

public static function isTestMethod(ReflectionMethod $method) {
  if (strpos($method->name, 'test') === 0) {
    return true;
  }

  // @scenario on TestCase::testMethod()
  // @test     on TestCase::testMethod()
  $doc_comment = $method
    ->getDocComment();
  return strpos($doc_comment, '@test') !== false || strpos($doc_comment, '@scenario') !== false;
}