예제 #1
0
 protected function walkThroughTests($test)
 {
     if ($test instanceof PHPUnit_Framework_TestSuite) {
         $tests = $test->tests();
         foreach ($tests as $testCase) {
             $this->walkThroughTests($testCase);
         }
     } else {
         if (WikiaTestSpeedAnnotator::isMarkedAsSlow($test->getAnnotations())) {
             $this->collectSlowTest($test);
             $this->displaySlowTest($test);
         }
     }
 }
예제 #2
0
 protected function tearDown()
 {
     global $wgAnnotateTestSpeed;
     $this->unsetGlobals();
     $this->unsetMessages();
     if ($this->mockProxy === null) {
         throw new Exception("Current test did not execute setUp()");
     }
     $this->mockProxy->disable();
     $this->mockProxy = null;
     if (WikiaTestSpeedAnnotator::isMarkedAsSlow($this->getAnnotations())) {
         self::$numberSlowTests++;
     }
     if ($wgAnnotateTestSpeed) {
         WikiaTestSpeedAnnotator::add(get_class($this), $this->getName(false), microtime(true) - $this->startTime, $this->getAnnotations());
     }
 }