Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 11
Línea 32... Línea 32...
32
    use \quizaccess_seb_test_helper_trait;
32
    use \quizaccess_seb_test_helper_trait;
Línea 33... Línea 33...
33
 
33
 
34
    /**
34
    /**
35
     * Test that we can check valid seb string.
35
     * Test that we can check valid seb string.
36
     */
36
     */
37
    public function test_is_valid_seb_config() {
37
    public function test_is_valid_seb_config(): void {
38
        $validseb = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
38
        $validseb = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
39
<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">
39
<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">
40
<plist version=\"1.0\"><dict><key>showTaskBar</key><true/><key>allowWlan</key><false/><key>showReloadButton</key><true/>"
40
<plist version=\"1.0\"><dict><key>showTaskBar</key><true/><key>allowWlan</key><false/><key>showReloadButton</key><true/>"
41
            . "<key>showTime</key><false/><key>showInputLanguage</key><true/><key>allowQuit</key><true/>"
41
            . "<key>showTime</key><false/><key>showInputLanguage</key><true/><key>allowQuit</key><true/>"
Línea 55... Línea 55...
55
    }
55
    }
Línea 56... Línea 56...
56
 
56
 
57
    /**
57
    /**
58
     * Test that we can get seb file headers.
58
     * Test that we can get seb file headers.
59
     */
59
     */
60
    public function test_get_seb_file_headers() {
60
    public function test_get_seb_file_headers(): void {
61
        $expiretime = 1582767914;
61
        $expiretime = 1582767914;
Línea 62... Línea 62...
62
        $headers = \quizaccess_seb\helper::get_seb_file_headers($expiretime);
62
        $headers = \quizaccess_seb\helper::get_seb_file_headers($expiretime);
63
 
63
 
Línea 71... Línea 71...
71
 
71
 
72
 
72
 
73
    /**
73
    /**
74
     * Test that the course module must exist to get a seb config file content.
74
     * Test that the course module must exist to get a seb config file content.
75
     */
75
     */
Línea 76... Línea 76...
76
    public function test_can_not_get_config_content_with_invalid_cmid() {
76
    public function test_can_not_get_config_content_with_invalid_cmid(): void {
77
        $this->resetAfterTest();
77
        $this->resetAfterTest();
78
 
78
 
Línea 97... Línea 97...
97
    }
97
    }
Línea 98... Línea 98...
98
 
98
 
99
    /**
99
    /**
100
     * Test that the user must be enrolled to get seb config content.
100
     * Test that the user must be enrolled to get seb config content.
101
     */
101
     */
102
    public function test_can_not_get_config_content_when_user_not_enrolled_in_course() {
102
    public function test_can_not_get_config_content_when_user_not_enrolled_in_course(): void {
Línea 103... Línea 103...
103
        $this->resetAfterTest();
103
        $this->resetAfterTest();
104
 
104
 
105
        $this->setAdminUser();
105
        $this->setAdminUser();
Línea 115... Línea 115...
115
    }
115
    }
Línea 116... Línea 116...
116
 
116
 
117
    /**
117
    /**
118
     * Test that if SEB quiz settings can't be found, a seb config content won't be provided.
118
     * Test that if SEB quiz settings can't be found, a seb config content won't be provided.
119
     */
119
     */
120
    public function test_can_not_get_config_content_if_config_not_found_for_cmid() {
120
    public function test_can_not_get_config_content_if_config_not_found_for_cmid(): void {
Línea 121... Línea 121...
121
        $this->resetAfterTest();
121
        $this->resetAfterTest();
122
 
122
 
123
        $this->setAdminUser();
123
        $this->setAdminUser();
Línea 134... Línea 134...
134
    }
134
    }
Línea 135... Línea 135...
135
 
135
 
136
    /**
136
    /**
137
     * That that if config is empty for a quiz, a seb config content won't be provided.
137
     * That that if config is empty for a quiz, a seb config content won't be provided.
138
     */
138
     */
139
    public function test_can_not_get_config_content_if_config_empty() {
139
    public function test_can_not_get_config_content_if_config_empty(): void {
Línea 140... Línea 140...
140
        $this->resetAfterTest();
140
        $this->resetAfterTest();
Línea 141... Línea 141...
141
 
141
 
Línea 154... Línea 154...
154
    }
154
    }
Línea 155... Línea 155...
155
 
155
 
156
    /**
156
    /**
157
     * Test config content is provided successfully.
157
     * Test config content is provided successfully.
158
     */
158
     */
159
    public function test_config_provided() {
159
    public function test_config_provided(): void {
Línea 160... Línea 160...
160
        $this->resetAfterTest();
160
        $this->resetAfterTest();
Línea 161... Línea 161...
161
 
161