Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 11
Línea 28... Línea 28...
28
class sessionlib_test extends \advanced_testcase {
28
class sessionlib_test extends \advanced_testcase {
Línea 29... Línea 29...
29
 
29
 
30
    /**
30
    /**
31
     * @covers ::cron_setup_user
31
     * @covers ::cron_setup_user
32
     */
32
     */
33
    public function test_cron_setup_user() {
33
    public function test_cron_setup_user(): void {
34
        // This function uses the $GLOBALS super global. Disable the VariableNameLowerCase sniff for this function.
34
        // This function uses the $GLOBALS super global. Disable the VariableNameLowerCase sniff for this function.
Línea 35... Línea 35...
35
        // phpcs:disable moodle.NamingConventions.ValidVariableName.VariableNameLowerCase
35
        // phpcs:disable moodle.NamingConventions.ValidVariableName.VariableNameLowerCase
36
 
36
 
Línea 243... Línea 243...
243
     * @dataProvider moodle_cookie_secure_provider
243
     * @dataProvider moodle_cookie_secure_provider
244
     *
244
     *
245
     * @param array $config Array of key value config settings
245
     * @param array $config Array of key value config settings
246
     * @param bool $secure Wether cookies should be secure or not
246
     * @param bool $secure Wether cookies should be secure or not
247
     */
247
     */
248
    public function test_is_moodle_cookie_secure($config, $secure) {
248
    public function test_is_moodle_cookie_secure($config, $secure): void {
249
        global $CFG;
249
        global $CFG;
250
        $this->resetAfterTest();
250
        $this->resetAfterTest();
251
        foreach ($config as $key => $value) {
251
        foreach ($config as $key => $value) {
252
            $CFG->$key = $value;
252
            $CFG->$key = $value;
253
        }
253
        }
254
        $this->assertEquals($secure, is_moodle_cookie_secure());
254
        $this->assertEquals($secure, is_moodle_cookie_secure());
255
    }
255
    }
Línea 256... Línea 256...
256
 
256
 
257
    public function test_sesskey() {
257
    public function test_sesskey(): void {
258
        global $USER;
258
        global $USER;
Línea 259... Línea 259...
259
        $this->resetAfterTest();
259
        $this->resetAfterTest();
Línea 279... Línea 279...
279
        $this->assertFalse(sesskey());
279
        $this->assertFalse(sesskey());
280
        $this->assertArrayNotHasKey('USER', $GLOBALS);
280
        $this->assertArrayNotHasKey('USER', $GLOBALS);
281
        $this->assertFalse(sesskey());
281
        $this->assertFalse(sesskey());
282
    }
282
    }
Línea 283... Línea 283...
283
 
283
 
284
    public function test_confirm_sesskey() {
284
    public function test_confirm_sesskey(): void {
Línea 285... Línea 285...
285
        $this->resetAfterTest();
285
        $this->resetAfterTest();
Línea 286... Línea 286...
286
 
286
 
Línea 301... Línea 301...
301
 
301
 
302
        $_GET['sesskey'] = 'blah';
302
        $_GET['sesskey'] = 'blah';
303
        $this->assertFalse(confirm_sesskey());
303
        $this->assertFalse(confirm_sesskey());
Línea 304... Línea 304...
304
    }
304
    }
305
 
305
 
Línea 306... Línea 306...
306
    public function test_require_sesskey() {
306
    public function test_require_sesskey(): void {
Línea 307... Línea 307...
307
        $this->resetAfterTest();
307
        $this->resetAfterTest();