getClassNamespace() 공개 메소드

public getClassNamespace ( )
예제 #1
0
 /**
  * @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]);
 }
예제 #2
0
파일: runner.php 프로젝트: ronan-gloo/atoum
 public static function isIgnored(test $test, array $namespaces, array $tags)
 {
     $isIgnored = $test->isIgnored();
     if ($isIgnored === false && $namespaces) {
         $classNamespace = strtolower($test->getClassNamespace());
         $isIgnored = sizeof(array_filter($namespaces, function ($value) use($classNamespace) {
             return strpos($classNamespace, strtolower($value)) === 0;
         })) <= 0;
     }
     if ($isIgnored === false && $tags) {
         $isIgnored = sizeof($testTags = $test->getAllTags()) <= 0 || sizeof(array_intersect($tags, $testTags)) == 0;
     }
     return $isIgnored;
 }