コード例 #1
0
ファイル: Factory.php プロジェクト: dalinhuang/shopexts
 /**
  * @param  PHPUnit_Framework_TestResult $result
  * @param  PHPUnit_Framework_TestSuite  $testSuite
  * @return array
  * @access protected
  * @since  Method available since Release 3.0.0
  */
 protected static function getTests(PHPUnit_Framework_TestResult $result, PHPUnit_Framework_TestSuite $testSuite = NULL)
 {
     if ($testSuite === NULL) {
         $testSuite = $result->topTestSuite();
     }
     $tests = array();
     foreach ($testSuite->tests() as $test) {
         if ($test instanceof PHPUnit_Framework_TestSuite) {
             $tests = array_merge($tests, self::getTests($result, $test));
         } else {
             $testName = PHPUnit_Util_Test::describe($test, FALSE);
             $tests[] = array('name' => $testName[1], 'object' => $test, 'result' => PHPUnit_Util_Test::lookupResult($test, $result));
         }
     }
     return array($testSuite->getName() => $tests);
 }