예제 #1
0
 /**
  * @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
 /**
  * @dataProvider testFilterDataProvider
  */
 public function testIsMethodIgnored($case, $rules)
 {
     $test = new \mock\mageekguy\atoum\test();
     $test->getMockController()->getTestMethods = array_keys($case['methodTags']);
     $test->getMockController()->getClass = $case['class'];
     $test->getMockController()->getClassNamespace = $case['classNamespace'];
     $test->getMockController()->getTestedClassName = $case['testedClassName'];
     $test->getMockController()->getTestedClassNameNamespace = $case['testedClassNamespace'];
     $test->getMockController()->getMethodTags = $case['methodTags'];
     $test->getMockController()->getMandatoryMethodExtensions = $case['mandatoryMethodExtensions'];
     foreach ($rules as $rule => $methodCases) {
         $testedClass = new testedClass($rule);
         foreach ($methodCases as $methodName => $isIgnored) {
             $this->boolean($testedClass->isMethodIgnored($test, $methodName))->isEqualTo($isIgnored, sprintf("rule : '%s' method: '%s', expected : %s", $rule, $methodName, var_export($isIgnored, true)));
         }
     }
 }