Línea 37... |
Línea 37... |
37 |
* @param float $siteorder The order for the siteadmin node
|
37 |
* @param float $siteorder The order for the siteadmin node
|
38 |
* @param float $courseorder The order for the course node
|
38 |
* @param float $courseorder The order for the course node
|
39 |
* @param float $moduleorder The order for the module node
|
39 |
* @param float $moduleorder The order for the module node
|
40 |
* @dataProvider leaf_nodes_order_provider
|
40 |
* @dataProvider leaf_nodes_order_provider
|
41 |
*/
|
41 |
*/
|
42 |
public function test_get_leaf_nodes(float $siteorder, float $courseorder, float $moduleorder) {
|
42 |
public function test_get_leaf_nodes(float $siteorder, float $courseorder, float $moduleorder): void {
|
43 |
global $PAGE;
|
43 |
global $PAGE;
|
Línea 44... |
Línea 44... |
44 |
|
44 |
|
45 |
// Create a secondary navigation and populate with some dummy nodes.
|
45 |
// Create a secondary navigation and populate with some dummy nodes.
|
46 |
$secondary = new secondary($PAGE);
|
46 |
$secondary = new secondary($PAGE);
|
Línea 260... |
Línea 260... |
260 |
* @param array $expecedmoremenunodes The array containing the keys of the expected navigation nodes which are
|
260 |
* @param array $expecedmoremenunodes The array containing the keys of the expected navigation nodes which are
|
261 |
* forced into the "more" menu
|
261 |
* forced into the "more" menu
|
262 |
* @dataProvider force_nodes_into_more_menu_provider
|
262 |
* @dataProvider force_nodes_into_more_menu_provider
|
263 |
*/
|
263 |
*/
|
264 |
public function test_force_nodes_into_more_menu(array $secondarynavnodesdata, array $defaultmoremenunodes,
|
264 |
public function test_force_nodes_into_more_menu(array $secondarynavnodesdata, array $defaultmoremenunodes,
|
265 |
?int $maxdisplayednodes, array $expecedmoremenunodes) {
|
265 |
?int $maxdisplayednodes, array $expecedmoremenunodes): void {
|
266 |
global $PAGE;
|
266 |
global $PAGE;
|
Línea 267... |
Línea 267... |
267 |
|
267 |
|
268 |
// Create a dummy secondary navigation.
|
268 |
// Create a dummy secondary navigation.
|
269 |
$secondary = new secondary($PAGE);
|
269 |
$secondary = new secondary($PAGE);
|
Línea 443... |
Línea 443... |
443 |
*
|
443 |
*
|
444 |
* @param string $selectedurl
|
444 |
* @param string $selectedurl
|
445 |
* @param string $expectednode
|
445 |
* @param string $expectednode
|
446 |
* @dataProvider nodes_match_current_url_provider
|
446 |
* @dataProvider nodes_match_current_url_provider
|
447 |
*/
|
447 |
*/
|
448 |
public function test_nodes_match_current_url(string $selectedurl, string $expectednode) {
|
448 |
public function test_nodes_match_current_url(string $selectedurl, string $expectednode): void {
|
449 |
global $PAGE;
|
449 |
global $PAGE;
|
450 |
$structure = [
|
450 |
$structure = [
|
451 |
'parentnode1' => [
|
451 |
'parentnode1' => [
|
452 |
'child1' => '/my',
|
452 |
'child1' => '/my',
|
453 |
'child2' => [
|
453 |
'child2' => [
|
Línea 492... |
Línea 492... |
492 |
*
|
492 |
*
|
493 |
* @param string $selected
|
493 |
* @param string $selected
|
494 |
* @param array $expected
|
494 |
* @param array $expected
|
495 |
* @dataProvider get_menu_array_provider
|
495 |
* @dataProvider get_menu_array_provider
|
496 |
*/
|
496 |
*/
|
497 |
public function test_get_menu_array(string $selected, array $expected) {
|
497 |
public function test_get_menu_array(string $selected, array $expected): void {
|
498 |
global $PAGE;
|
498 |
global $PAGE;
|
Línea 499... |
Línea 499... |
499 |
|
499 |
|
500 |
// Custom nodes - mimicing nodes added via 3rd party plugins.
|
500 |
// Custom nodes - mimicing nodes added via 3rd party plugins.
|
501 |
$structure = [
|
501 |
$structure = [
|
Línea 584... |
Línea 584... |
584 |
*
|
584 |
*
|
585 |
* @param string $selectedkey
|
585 |
* @param string $selectedkey
|
586 |
* @param string|null $expectedkey
|
586 |
* @param string|null $expectedkey
|
587 |
* @dataProvider get_node_with_first_action_provider
|
587 |
* @dataProvider get_node_with_first_action_provider
|
588 |
*/
|
588 |
*/
|
589 |
public function test_get_node_with_first_action(string $selectedkey, ?string $expectedkey) {
|
589 |
public function test_get_node_with_first_action(string $selectedkey, ?string $expectedkey): void {
|
590 |
global $PAGE;
|
590 |
global $PAGE;
|
591 |
$structure = [
|
591 |
$structure = [
|
592 |
'parentnode1' => [
|
592 |
'parentnode1' => [
|
593 |
'child1' => [
|
593 |
'child1' => [
|
594 |
'child1.1' => null
|
594 |
'child1.1' => null
|
Línea 662... |
Línea 662... |
662 |
* @param array $structure The structure of the navigation node tree to setup with.
|
662 |
* @param array $structure The structure of the navigation node tree to setup with.
|
663 |
* @param array $expectednodes The expected nodes added to the secondary navigation
|
663 |
* @param array $expectednodes The expected nodes added to the secondary navigation
|
664 |
* @param bool $separatenode Whether or not to create a separate node to add nodes to.
|
664 |
* @param bool $separatenode Whether or not to create a separate node to add nodes to.
|
665 |
* @dataProvider add_external_nodes_to_secondary_provider
|
665 |
* @dataProvider add_external_nodes_to_secondary_provider
|
666 |
*/
|
666 |
*/
|
667 |
public function test_add_external_nodes_to_secondary(array $structure, array $expectednodes, bool $separatenode = false) {
|
667 |
public function test_add_external_nodes_to_secondary(array $structure, array $expectednodes, bool $separatenode = false): void {
|
668 |
global $PAGE;
|
668 |
global $PAGE;
|
Línea 669... |
Línea 669... |
669 |
|
669 |
|
670 |
$this->resetAfterTest();
|
670 |
$this->resetAfterTest();
|
671 |
$course = $this->getDataGenerator()->create_course();
|
671 |
$course = $this->getDataGenerator()->create_course();
|
Línea 801... |
Línea 801... |
801 |
* @param string $selectedurl
|
801 |
* @param string $selectedurl
|
802 |
* @param bool $expectednull
|
802 |
* @param bool $expectednull
|
803 |
* @param bool $emptynode
|
803 |
* @param bool $emptynode
|
804 |
* @dataProvider get_overflow_menu_data_provider
|
804 |
* @dataProvider get_overflow_menu_data_provider
|
805 |
*/
|
805 |
*/
|
806 |
public function test_get_overflow_menu_data(string $selectedurl, bool $expectednull, bool $emptynode = false) {
|
806 |
public function test_get_overflow_menu_data(string $selectedurl, bool $expectednull, bool $emptynode = false): void {
|
807 |
global $PAGE;
|
807 |
global $PAGE;
|
Línea 808... |
Línea 808... |
808 |
|
808 |
|
809 |
$this->resetAfterTest();
|
809 |
$this->resetAfterTest();
|
810 |
// Custom nodes - mimicing nodes added via 3rd party plugins.
|
810 |
// Custom nodes - mimicing nodes added via 3rd party plugins.
|