コード例 #1
0
ファイル: SlowTestsFinder.php プロジェクト: Tjorriemorrie/app
 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());
     }
 }