| Línea 24... |
Línea 24... |
| 24 |
* @package core
|
24 |
* @package core
|
| 25 |
* @category navigation
|
25 |
* @category navigation
|
| 26 |
* @copyright 2021 onwards Peter Dias
|
26 |
* @copyright 2021 onwards Peter Dias
|
| 27 |
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
27 |
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
| 28 |
*/
|
28 |
*/
|
| 29 |
class primary_test extends \advanced_testcase {
|
29 |
final class primary_test extends \advanced_testcase {
|
| 30 |
/**
|
30 |
/**
|
| 31 |
* Basic setup to make sure the nav objects gets generated without any issues.
|
31 |
* Basic setup to make sure the nav objects gets generated without any issues.
|
| 32 |
*/
|
32 |
*/
|
| 33 |
public function setUp(): void {
|
33 |
public function setUp(): void {
|
| 34 |
global $PAGE;
|
34 |
global $PAGE;
|
| - |
|
35 |
parent::setUp();
|
| 35 |
$this->resetAfterTest();
|
36 |
$this->resetAfterTest();
|
| 36 |
$pagecourse = $this->getDataGenerator()->create_course();
|
37 |
$pagecourse = $this->getDataGenerator()->create_course();
|
| 37 |
$assign = $this->getDataGenerator()->create_module('assign', ['course' => $pagecourse->id]);
|
38 |
$assign = $this->getDataGenerator()->create_module('assign', ['course' => $pagecourse->id]);
|
| 38 |
$cm = get_coursemodule_from_id('assign', $assign->cmid);
|
39 |
$cm = get_coursemodule_from_id('assign', $assign->cmid);
|
| 39 |
$contextrecord = \context_module::instance($cm->id);
|
40 |
$contextrecord = \context_module::instance($cm->id);
|
| Línea 111... |
Línea 112... |
| 111 |
/**
|
112 |
/**
|
| 112 |
* Provider for the test_primary_export function.
|
113 |
* Provider for the test_primary_export function.
|
| 113 |
*
|
114 |
*
|
| 114 |
* @return array
|
115 |
* @return array
|
| 115 |
*/
|
116 |
*/
|
| 116 |
public function primary_export_provider(): array {
|
117 |
public static function primary_export_provider(): array {
|
| 117 |
return [
|
118 |
return [
|
| 118 |
"Export the menu data when: custom menu exists; multiple langs installed; user is not logged in." => [
|
119 |
"Export the menu data when: custom menu exists; multiple langs installed; user is not logged in." => [
|
| 119 |
true, true, '', ['mobileprimarynav', 'moremenu', 'lang', 'user']
|
120 |
true, true, '', ['mobileprimarynav', 'moremenu', 'lang', 'user']
|
| 120 |
],
|
121 |
],
|
| 121 |
"Export the menu data when: custom menu exists; langs not installed; user is not logged in." => [
|
122 |
"Export the menu data when: custom menu exists; langs not installed; user is not logged in." => [
|
| Línea 187... |
Línea 188... |
| 187 |
/**
|
188 |
/**
|
| 188 |
* Provider for test_get_custom_menu
|
189 |
* Provider for test_get_custom_menu
|
| 189 |
*
|
190 |
*
|
| 190 |
* @return array
|
191 |
* @return array
|
| 191 |
*/
|
192 |
*/
|
| 192 |
public function custom_menu_provider(): array {
|
193 |
public static function custom_menu_provider(): array {
|
| 193 |
return [
|
194 |
return [
|
| 194 |
'Simple custom menu' => [
|
195 |
'Simple custom menu' => [
|
| 195 |
"Course search|/course/search.php
|
196 |
"Course search|/course/search.php
|
| 196 |
Google|https://google.com.au/
|
197 |
Google|https://google.com.au/
|
| 197 |
Netflix|https://netflix.com/au", [
|
198 |
Netflix|https://netflix.com/au", [
|