コード例 #1
0
ファイル: test_case.php プロジェクト: nuckey/moodle
 /**
  *    Builds a test suite from a class list.
  *    @param string $title       Title of new group.
  *    @param array $classes      Test classes.
  *    @return TestSuite          Group loaded with the new
  *                               test cases.
  *    @access public
  */
 function &createSuiteFromClasses($title, $classes) {
     if (count($classes) == 0) {
         $suite = new BadTestSuite($title, "No runnable test cases in [$title]");
         return $suite;
     }
     SimpleTest::ignoreParentsIfIgnored($classes);
     $suite = new TestSuite($title);
     foreach ($classes as $class) {
         if (! SimpleTest::isIgnored($class)) {
             $suite->addTestClass($class);
         }
     }
     return $suite;
 }
コード例 #2
0
 /**
  *    Builds a group test from a class list.
  *    @param string $title       Title of new group.
  *    @param array $classes      Test classes.
  *    @return TestSuite          Group loaded with the new
  *                               test cases.
  *    @access private
  */
 function &_createGroupFromClasses($title, $classes)
 {
     SimpleTest::ignoreParentsIfIgnored($classes);
     $group = new TestSuite($title);
     foreach ($classes as $class) {
         if (!SimpleTest::isIgnored($class)) {
             $group->addTestClass($class);
         }
     }
     return $group;
 }