Proyectos de Subversion Moodle

Rev

Rev 11 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 11 Rev 1441
Línea 28... Línea 28...
28
 * @coversDefaultClass \core_badges\output\manage_badge_action_bar
28
 * @coversDefaultClass \core_badges\output\manage_badge_action_bar
29
 * @package     core_badges
29
 * @package     core_badges
30
 * @copyright   2021 onwards Peter Dias
30
 * @copyright   2021 onwards Peter Dias
31
 * @license     http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
31
 * @license     http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
32
 */
32
 */
33
class manage_badge_action_bar_test extends \advanced_testcase {
33
final class manage_badge_action_bar_test extends \advanced_testcase {
34
    /**
34
    /**
35
     * Data provider for test_generate_badge_navigation
35
     * Data provider for test_generate_badge_navigation
36
     *
36
     *
37
     * @return array
37
     * @return array
38
     */
38
     */
39
    public function generate_badge_navigation_provider(): array {
39
    public static function generate_badge_navigation_provider(): array {
40
        return [
40
        return [
41
            "Test tertiary nav as an editing teacher" => [
41
            "Test tertiary nav as an editing teacher" => [
42
                "editingteacher", [
42
                "editingteacher", [
43
                    'Overview',
43
                    'Overview',
44
                    'Edit details',
44
                    'Edit details',
Línea 67... Línea 67...
67
                    'Related badges (0)',
67
                    'Related badges (0)',
68
                    'Alignments (0)'
68
                    'Alignments (0)'
69
                ]
69
                ]
70
            ],
70
            ],
71
            "Test tertiary nav as a student" => [
71
            "Test tertiary nav as a student" => [
72
                "student", [
72
                "student", [],
73
                    'Overview'
-
 
74
                ]
-
 
75
            ]
73
            ]
76
        ];
74
        ];
77
    }
75
    }
Línea 78... Línea 76...
78
 
76
 
Línea 118... Línea 116...
118
        $badge->attachment = 1;
116
        $badge->attachment = 1;
119
        $badge->notification = 0;
117
        $badge->notification = 0;
120
        $badge->status = BADGE_STATUS_ACTIVE;
118
        $badge->status = BADGE_STATUS_ACTIVE;
121
        $badge->version = '1';
119
        $badge->version = '1';
122
        $badge->language = 'en';
120
        $badge->language = 'en';
123
        $badge->imageauthorname = 'Image author';
-
 
124
        $badge->imageauthoremail = 'imageauthor@example.com';
-
 
125
        $badge->imageauthorurl = 'http://image-author-url.domain.co.nz';
-
 
126
        $badge->imagecaption = 'Caption';
121
        $badge->imagecaption = 'Caption';
127
        $coursebadgeid = $DB->insert_record('badge', $badge, true);
122
        $coursebadgeid = $DB->insert_record('badge', $badge, true);
128
        $badge = new \core_badges\badge($coursebadgeid);
123
        $badge = new \core_badges\badge($coursebadgeid);
Línea 129... Línea 124...
129
 
124