Línea 75... |
Línea 75... |
75 |
$constructor->invoke($mockcategory, $category->get_db_record());
|
75 |
$constructor->invoke($mockcategory, $category->get_db_record());
|
Línea 76... |
Línea 76... |
76 |
|
76 |
|
77 |
return $mockcategory;
|
77 |
return $mockcategory;
|
Línea 78... |
Línea 78... |
78 |
}
|
78 |
}
|
79 |
|
79 |
|
80 |
public function test_can_course_category_delete_hook() {
|
80 |
public function test_can_course_category_delete_hook(): void {
|
81 |
$category1 = \core_course_category::create(array('name' => 'Cat1'));
|
81 |
$category1 = \core_course_category::create(array('name' => 'Cat1'));
|
Línea 82... |
Línea 82... |
82 |
$category2 = \core_course_category::create(array('name' => 'Cat2', 'parent' => $category1->id));
|
82 |
$category2 = \core_course_category::create(array('name' => 'Cat2', 'parent' => $category1->id));
|
Línea 102... |
Línea 102... |
102 |
// Argument 1 is the same core_course_category instance.
|
102 |
// Argument 1 is the same core_course_category instance.
|
103 |
$argument = array_shift($arguments);
|
103 |
$argument = array_shift($arguments);
|
104 |
$this->assertSame($mockcategory2, $argument);
|
104 |
$this->assertSame($mockcategory2, $argument);
|
105 |
}
|
105 |
}
|
Línea 106... |
Línea 106... |
106 |
|
106 |
|
107 |
public function test_can_course_category_delete_move_hook() {
|
107 |
public function test_can_course_category_delete_move_hook(): void {
|
108 |
$category1 = \core_course_category::create(array('name' => 'Cat1'));
|
108 |
$category1 = \core_course_category::create(array('name' => 'Cat1'));
|
109 |
$category2 = \core_course_category::create(array('name' => 'Cat2', 'parent' => $category1->id));
|
109 |
$category2 = \core_course_category::create(array('name' => 'Cat2', 'parent' => $category1->id));
|
Línea 110... |
Línea 110... |
110 |
$category3 = \core_course_category::create(array('name' => 'Cat3'));
|
110 |
$category3 = \core_course_category::create(array('name' => 'Cat3'));
|
Línea 134... |
Línea 134... |
134 |
$argument = array_shift($arguments);
|
134 |
$argument = array_shift($arguments);
|
135 |
$this->assertInstanceOf(\core_course_category::class, $argument);
|
135 |
$this->assertInstanceOf(\core_course_category::class, $argument);
|
136 |
$this->assertEquals($category3->id, $argument->id);
|
136 |
$this->assertEquals($category3->id, $argument->id);
|
137 |
}
|
137 |
}
|
Línea 138... |
Línea 138... |
138 |
|
138 |
|
139 |
public function test_pre_course_category_delete_hook() {
|
139 |
public function test_pre_course_category_delete_hook(): void {
|
140 |
$category1 = \core_course_category::create(array('name' => 'Cat1'));
|
140 |
$category1 = \core_course_category::create(array('name' => 'Cat1'));
|
Línea 141... |
Línea 141... |
141 |
$category2 = \core_course_category::create(array('name' => 'Cat2', 'parent' => $category1->id));
|
141 |
$category2 = \core_course_category::create(array('name' => 'Cat2', 'parent' => $category1->id));
|
142 |
|
142 |
|
Línea 150... |
Línea 150... |
150 |
// Argument 1 is the category object.
|
150 |
// Argument 1 is the category object.
|
151 |
$argument = array_shift($arguments);
|
151 |
$argument = array_shift($arguments);
|
152 |
$this->assertEquals($mockcategory2->get_db_record(), $argument);
|
152 |
$this->assertEquals($mockcategory2->get_db_record(), $argument);
|
153 |
}
|
153 |
}
|
Línea 154... |
Línea 154... |
154 |
|
154 |
|
155 |
public function test_pre_course_category_delete_move_hook() {
|
155 |
public function test_pre_course_category_delete_move_hook(): void {
|
156 |
$category1 = \core_course_category::create(array('name' => 'Cat1'));
|
156 |
$category1 = \core_course_category::create(array('name' => 'Cat1'));
|
157 |
$category2 = \core_course_category::create(array('name' => 'Cat2', 'parent' => $category1->id));
|
157 |
$category2 = \core_course_category::create(array('name' => 'Cat2', 'parent' => $category1->id));
|
Línea 158... |
Línea 158... |
158 |
$category3 = \core_course_category::create(array('name' => 'Cat3'));
|
158 |
$category3 = \core_course_category::create(array('name' => 'Cat3'));
|
Línea 176... |
Línea 176... |
176 |
$argument = array_shift($arguments);
|
176 |
$argument = array_shift($arguments);
|
177 |
$this->assertInstanceOf(\core_course_category::class, $argument);
|
177 |
$this->assertInstanceOf(\core_course_category::class, $argument);
|
178 |
$this->assertEquals($category3->id, $argument->id);
|
178 |
$this->assertEquals($category3->id, $argument->id);
|
179 |
}
|
179 |
}
|
Línea 180... |
Línea 180... |
180 |
|
180 |
|
181 |
public function test_get_course_category_contents_hook() {
|
181 |
public function test_get_course_category_contents_hook(): void {
|
182 |
$category1 = \core_course_category::create(array('name' => 'Cat1'));
|
182 |
$category1 = \core_course_category::create(array('name' => 'Cat1'));
|
Línea 183... |
Línea 183... |
183 |
$category2 = \core_course_category::create(array('name' => 'Cat2', 'parent' => $category1->id));
|
183 |
$category2 = \core_course_category::create(array('name' => 'Cat2', 'parent' => $category1->id));
|