示例#1
0
 /**
  * Test listing loop categories.
  */
 public function test_tool_health_category_list_loops()
 {
     $loops = array((object) array('id' => 2, 'parent' => 3, 'name' => 'test'));
     $result = tool_health_category_list_loops($loops);
     $this->assertRegExp('/Category 2: test/', $result);
 }
示例#2
0
文件: index.php 项目: evltuma/moodle
 /**
  * Generate problem description.
  *
  * @return string HTML containing details of the problem.
  */
 public function description()
 {
     list($missingparent, $loops) = $this->find_problems();
     $description = '<p>The course categories should be arranged into tree ' . ' structures by the course_categories.parent field. Sometimes ' . ' this tree structure gets messed up.</p>';
     $description .= tool_health_category_list_missing_parents($missingparent);
     $description .= tool_health_category_list_loops($loops);
     return $description;
 }