isTest() protected method

Currently any method that starts with 'test' is a candidate unless it is the constructor.
protected isTest ( string $method ) : boolean
$method string Method name to try.
return boolean True if test method.
Ejemplo n.º 1
0
 /**
  *    Calculates the incoming test cases. Skips abstract
  *    and ignored classes.
  *    @param array $candidates   Candidate classes.
  *    @return array              New classes which are test
  *                               cases that shouldn't be ignored.
  *    @access public
  */
 function selectRunnableTests($candidates)
 {
     $classes = array();
     foreach ($candidates as $class) {
         if (TestSuite::getBaseTestCase($class)) {
             $reflection = new SimpleReflection($class);
             if ($reflection->isAbstract()) {
                 SimpleTest::ignore($class);
             } else {
                 // only pick classes which do have test methods we can run:
                 $methods = $reflection->getMethods();
                 foreach ($methods as $method) {
                     if (SimpleTestCase::isTest($class, $method)) {
                         $classes[] = $class;
                         break;
                     }
                 }
             }
         }
     }
     return $classes;
 }