Línea 34... |
Línea 34... |
34 |
/**
|
34 |
/**
|
35 |
* Test get_content() in the system context with users that have capability to access/view content bank content
|
35 |
* Test get_content() in the system context with users that have capability to access/view content bank content
|
36 |
* within the system context. By default, every authenticated user should be able to access/view the content in
|
36 |
* within the system context. By default, every authenticated user should be able to access/view the content in
|
37 |
* the system context.
|
37 |
* the system context.
|
38 |
*/
|
38 |
*/
|
39 |
public function test_get_content_system_context_user_has_capabilities() {
|
39 |
public function test_get_content_system_context_user_has_capabilities(): void {
|
40 |
global $DB, $CFG;
|
40 |
global $DB, $CFG;
|
Línea 41... |
Línea 41... |
41 |
|
41 |
|
Línea 42... |
Línea 42... |
42 |
$this->resetAfterTest(true);
|
42 |
$this->resetAfterTest(true);
|
Línea 123... |
Línea 123... |
123 |
/**
|
123 |
/**
|
124 |
* Test get_content() in the system context with users that do not have a capability to access/view content bank
|
124 |
* Test get_content() in the system context with users that do not have a capability to access/view content bank
|
125 |
* content within the system context. By default, every non-authenticated user should not be able to access/view
|
125 |
* content within the system context. By default, every non-authenticated user should not be able to access/view
|
126 |
* the content in the system context.
|
126 |
* the content in the system context.
|
127 |
*/
|
127 |
*/
|
128 |
public function test_get_content_system_context_user_missing_capabilities() {
|
128 |
public function test_get_content_system_context_user_missing_capabilities(): void {
|
129 |
$this->resetAfterTest(true);
|
129 |
$this->resetAfterTest(true);
|
Línea 130... |
Línea 130... |
130 |
|
130 |
|
Línea 131... |
Línea 131... |
131 |
$systemcontext = \context_system::instance();
|
131 |
$systemcontext = \context_system::instance();
|
Línea 148... |
Línea 148... |
148 |
/**
|
148 |
/**
|
149 |
* Test get_content() in the course category context with users that have capability to access/view content
|
149 |
* Test get_content() in the course category context with users that have capability to access/view content
|
150 |
* bank content within the course category context. By default, every authenticated user that has access to
|
150 |
* bank content within the course category context. By default, every authenticated user that has access to
|
151 |
* any category course should be able to access/view the content in the course category context.
|
151 |
* any category course should be able to access/view the content in the course category context.
|
152 |
*/
|
152 |
*/
|
153 |
public function test_get_content_course_category_context_user_has_capabilities() {
|
153 |
public function test_get_content_course_category_context_user_has_capabilities(): void {
|
154 |
global $CFG;
|
154 |
global $CFG;
|
Línea 155... |
Línea 155... |
155 |
|
155 |
|
Línea 156... |
Línea 156... |
156 |
$this->resetAfterTest(true);
|
156 |
$this->resetAfterTest(true);
|
Línea 220... |
Línea 220... |
220 |
* Test get_content() in the course category context with users that do not have capability to access/view content
|
220 |
* Test get_content() in the course category context with users that do not have capability to access/view content
|
221 |
* bank content within the course category context. By default, every non-authenticated user or authenticated users
|
221 |
* bank content within the course category context. By default, every non-authenticated user or authenticated users
|
222 |
* that cannot access/view course content from the course category should not be able to access/view the
|
222 |
* that cannot access/view course content from the course category should not be able to access/view the
|
223 |
* content in the course category context.
|
223 |
* content in the course category context.
|
224 |
*/
|
224 |
*/
|
225 |
public function test_get_content_course_category_context_user_missing_capabilities() {
|
225 |
public function test_get_content_course_category_context_user_missing_capabilities(): void {
|
226 |
$this->resetAfterTest(true);
|
226 |
$this->resetAfterTest(true);
|
Línea 227... |
Línea 227... |
227 |
|
227 |
|
228 |
// Create a course category 'Category'.
|
228 |
// Create a course category 'Category'.
|
229 |
$category = $this->getDataGenerator()->create_category(['name' => 'Category']);
|
229 |
$category = $this->getDataGenerator()->create_category(['name' => 'Category']);
|
Línea 272... |
Línea 272... |
272 |
/**
|
272 |
/**
|
273 |
* Test get_content() in the course context with users that have capability to access/view content
|
273 |
* Test get_content() in the course context with users that have capability to access/view content
|
274 |
* bank content within the course context. By default, admin, managers, course creators, editing teachers enrolled
|
274 |
* bank content within the course context. By default, admin, managers, course creators, editing teachers enrolled
|
275 |
* in the course should be able to access/view the content.
|
275 |
* in the course should be able to access/view the content.
|
276 |
*/
|
276 |
*/
|
277 |
public function test_get_content_course_context_user_has_capabilities() {
|
277 |
public function test_get_content_course_context_user_has_capabilities(): void {
|
278 |
global $CFG;
|
278 |
global $CFG;
|
Línea 279... |
Línea 279... |
279 |
|
279 |
|
Línea 280... |
Línea 280... |
280 |
$this->resetAfterTest(true);
|
280 |
$this->resetAfterTest(true);
|
Línea 321... |
Línea 321... |
321 |
/**
|
321 |
/**
|
322 |
* Test get_content() in the course context with users that do not have capability to access/view content
|
322 |
* Test get_content() in the course context with users that do not have capability to access/view content
|
323 |
* bank content within the course context. By default, every user which is not an admin, manager, course creator,
|
323 |
* bank content within the course context. By default, every user which is not an admin, manager, course creator,
|
324 |
* editing teacher enrolled in the course should not be able to access/view the content.
|
324 |
* editing teacher enrolled in the course should not be able to access/view the content.
|
325 |
*/
|
325 |
*/
|
326 |
public function test_get_content_course_context_user_missing_capabilities() {
|
326 |
public function test_get_content_course_context_user_missing_capabilities(): void {
|
327 |
$this->resetAfterTest(true);
|
327 |
$this->resetAfterTest(true);
|
Línea 328... |
Línea 328... |
328 |
|
328 |
|
329 |
// Create course1.
|
329 |
// Create course1.
|
330 |
$course1 = $this->getDataGenerator()->create_course(['fullname' => 'Course1']);
|
330 |
$course1 = $this->getDataGenerator()->create_course(['fullname' => 'Course1']);
|
Línea 367... |
Línea 367... |
367 |
}
|
367 |
}
|
Línea 368... |
Línea 368... |
368 |
|
368 |
|
369 |
/**
|
369 |
/**
|
370 |
* Test get_navigation() in the system context.
|
370 |
* Test get_navigation() in the system context.
|
371 |
*/
|
371 |
*/
|
372 |
public function test_get_navigation_system_context() {
|
372 |
public function test_get_navigation_system_context(): void {
|
Línea 373... |
Línea 373... |
373 |
$this->resetAfterTest(true);
|
373 |
$this->resetAfterTest(true);
|
Línea 374... |
Línea 374... |
374 |
|
374 |
|
Línea 385... |
Línea 385... |
385 |
}
|
385 |
}
|
Línea 386... |
Línea 386... |
386 |
|
386 |
|
387 |
/**
|
387 |
/**
|
388 |
* Test get_navigation() in the course category context.
|
388 |
* Test get_navigation() in the course category context.
|
389 |
*/
|
389 |
*/
|
390 |
public function test_get_navigation_course_category_context() {
|
390 |
public function test_get_navigation_course_category_context(): void {
|
Línea 391... |
Línea 391... |
391 |
$this->resetAfterTest(true);
|
391 |
$this->resetAfterTest(true);
|
392 |
|
392 |
|
393 |
$systemcontext = \context_system::instance();
|
393 |
$systemcontext = \context_system::instance();
|
Línea 425... |
Línea 425... |
425 |
}
|
425 |
}
|
Línea 426... |
Línea 426... |
426 |
|
426 |
|
427 |
/**
|
427 |
/**
|
428 |
* Test get_navigation() in the course context.
|
428 |
* Test get_navigation() in the course context.
|
429 |
*/
|
429 |
*/
|
430 |
public function test_get_navigation_course_context() {
|
430 |
public function test_get_navigation_course_context(): void {
|
Línea 431... |
Línea 431... |
431 |
$this->resetAfterTest(true);
|
431 |
$this->resetAfterTest(true);
|
432 |
|
432 |
|
433 |
$systemcontext = \context_system::instance();
|
433 |
$systemcontext = \context_system::instance();
|