Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 11
Línea 27... Línea 27...
27
 * @category   test
27
 * @category   test
28
 * @copyright  2013 Petr Skoda {@link http://skodak.org}
28
 * @copyright  2013 Petr Skoda {@link http://skodak.org}
29
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
29
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
30
 */
30
 */
31
class minify_test extends \advanced_testcase {
31
class minify_test extends \advanced_testcase {
32
    public function test_css() {
32
    public function test_css(): void {
33
        $css = "
33
        $css = "
34
body {
34
body {
35
background: #fff;
35
background: #fff;
36
margin: 0;
36
margin: 0;
37
padding: 0;
37
padding: 0;
Línea 39... Línea 39...
39
}";
39
}";
Línea 40... Línea 40...
40
 
40
 
41
        $this->assertSame("body{background:#fff;margin:0;padding:0;color:#281f18}", core_minify::css($css));
41
        $this->assertSame("body{background:#fff;margin:0;padding:0;color:#281f18}", core_minify::css($css));
Línea 42... Línea 42...
42
    }
42
    }
43
 
43
 
Línea 44... Línea 44...
44
    public function test_css_files() {
44
    public function test_css_files(): void {
45
        global $CFG;
45
        global $CFG;
46
 
46
 
Línea 73... Línea 73...
73
 
73
 
74
        unlink($testfile1);
74
        unlink($testfile1);
75
        unlink($testfile2);
75
        unlink($testfile2);
Línea 76... Línea 76...
76
    }
76
    }
77
 
77
 
78
    public function test_js() {
78
    public function test_js(): void {
79
        $js = "
79
        $js = "
80
function hm()
80
function hm()
81
{
81
{
Línea 87... Línea 87...
87
        $js = "function hm{}";
87
        $js = "function hm{}";
88
        $result = core_minify::js($js);
88
        $result = core_minify::js($js);
89
        $this->assertStringContainsString($js, $result);
89
        $this->assertStringContainsString($js, $result);
90
    }
90
    }
Línea 91... Línea 91...
91
 
91
 
92
    public function test_js_files() {
92
    public function test_js_files(): void {
Línea 93... Línea 93...
93
        global $CFG;
93
        global $CFG;
94
 
94
 
95
        $testfile1 = "$CFG->tempdir/test1.js";
95
        $testfile1 = "$CFG->tempdir/test1.js";