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
class configonlylib_test extends \advanced_testcase {
32
class configonlylib_test extends \advanced_testcase {
Línea 33... Línea 33...
33
 
33
 
34
    /**
34
    /**
35
     * Test cleaning of invalid utf-8 entities.
35
     * Test cleaning of invalid utf-8 entities.
36
     */
36
     */
37
    public function test_min_fix_utf8() {
37
    public function test_min_fix_utf8(): void {
38
        $this->assertSame('abc', min_fix_utf8('abc'));
38
        $this->assertSame('abc', min_fix_utf8('abc'));
39
        $this->assertSame("žlutý koníček přeskočil potůček \n\t\r", min_fix_utf8("žlutý koníček přeskočil potůček \n\t\r\0"));
39
        $this->assertSame("žlutý koníček přeskočil potůček \n\t\r", min_fix_utf8("žlutý koníček přeskočil potůček \n\t\r\0"));
40
        $this->assertSame('aš', min_fix_utf8('a'.chr(130).'š'), 'This fails with buggy iconv() when mbstring extenstion is not available as fallback.');
40
        $this->assertSame('aš', min_fix_utf8('a'.chr(130).'š'), 'This fails with buggy iconv() when mbstring extenstion is not available as fallback.');
Línea 41... Línea 41...
41
    }
41
    }
42
 
42
 
43
    /**
43
    /**
44
     * Test minimalistic parameter cleaning.
44
     * Test minimalistic parameter cleaning.
45
     */
45
     */
46
    public function test_min_clean_param() {
46
    public function test_min_clean_param(): void {
Línea 47... Línea 47...
47
        $this->assertSame('foo', min_clean_param('foo', 'RAW'));
47
        $this->assertSame('foo', min_clean_param('foo', 'RAW'));
48
        $this->assertSame('aš', min_clean_param('a'.chr(130).'š', 'RAW'));
48
        $this->assertSame('aš', min_clean_param('a'.chr(130).'š', 'RAW'));
Línea 58... Línea 58...
58
    }
58
    }
Línea 59... Línea 59...
59
 
59
 
60
    /**
60
    /**
61
     * Test minimalistic getting of page parameters.
61
     * Test minimalistic getting of page parameters.
62
     */
62
     */
63
    public function test_min_optional_param() {
63
    public function test_min_optional_param(): void {
Línea 64... Línea 64...
64
        $this->resetAfterTest();
64
        $this->resetAfterTest();
65
 
65
 
66
        $_GET['foo'] = 'bar';
66
        $_GET['foo'] = 'bar';
Línea 79... Línea 79...
79
    }
79
    }
Línea 80... Línea 80...
80
 
80
 
81
    /**
81
    /**
82
     * Test fail-safe minimalistic slashargument processing.
82
     * Test fail-safe minimalistic slashargument processing.
83
     */
83
     */
84
    public function test_min_get_slash_argument() {
84
    public function test_min_get_slash_argument(): void {
Línea 85... Línea 85...
85
        global $CFG;
85
        global $CFG;
86
 
86