getTestMethods() public method

public getTestMethods ( array $tags = [] )
$tags array
コード例 #1
0
ファイル: extension.php プロジェクト: atoum/ruler-extension
 /**
  * @param test $test
  * @return $this
  */
 public function setTest(test $test)
 {
     if (null === $this->rule) {
         return $this;
     }
     $ruler = new ruler($this->rule);
     foreach ($test->getTestMethods() as $testMethod) {
         $isMethodIgnored = $ruler->isMethodIgnored($test, $testMethod);
         $test->ignoreMethod($testMethod, $isMethodIgnored);
     }
     return $this;
 }
コード例 #2
0
ファイル: ruler.php プロジェクト: atoum/ruler-extension
 /**
  * @param test   $test
  * @param string $methodNameToCheck
  * @return bool
  * @throws \RuntimeException
  */
 public function isMethodIgnored(test $test, $methodNameToCheck)
 {
     $contexts = array();
     foreach ($test->getTestMethods() as $methodName) {
         $contexts[$methodName] = new HoaContext();
         $contexts[$methodName]['method'] = $methodName;
         $contexts[$methodName]['class'] = $test->getClass();
         $contexts[$methodName]['namespace'] = $test->getClassNamespace();
         $contexts[$methodName]['testedclass'] = $test->getTestedClassName();
         $contexts[$methodName]['testedclassnamespace'] = $test->getTestedClassNamespace();
     }
     foreach ($test->getMandatoryMethodExtensions() as $methodName => $extensions) {
         $contexts[$methodName]['extensions'] = $extensions;
     }
     foreach ($test->getMethodTags() as $methodName => $tags) {
         $contexts[$methodName]['tags'] = $tags;
     }
     if (!isset($contexts[$methodNameToCheck])) {
         throw new \RuntimeException(sprintf('Method not found : %s', $methodNameToCheck));
     }
     return false === $this->ruler->assert($this->rule, $contexts[$methodNameToCheck]);
 }
コード例 #3
0
ファイル: runner.php プロジェクト: ronan-gloo/atoum
 private static function getMethods(test $test, array $runTestMethods, array $tags)
 {
     $methods = array();
     if (isset($runTestMethods['*']) === true) {
         $methods = $runTestMethods['*'];
     }
     $testClass = $test->getClass();
     if (isset($runTestMethods[$testClass]) === true) {
         $methods = $runTestMethods[$testClass];
     }
     if (in_array('*', $methods) === true) {
         $methods = array();
     }
     if (sizeof($methods) <= 0) {
         $methods = $test->getTestMethods($tags);
     } else {
         $methods = $test->getTaggedTestMethods($methods, $tags);
     }
     return $methods;
 }