summaryrefslogtreecommitdiff
path: root/plugins/Minify/extlib/minify/min_unit_tests/test_Minify_Lines.php
blob: c518fce3988980d39d5c9d4d5194e86829d30e17 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php

require_once '_inc.php';
require_once 'Minify.php';

function test_Lines()
{
    global $thisDir;
    
    $exp = file_get_contents("{$thisDir}/_test_files/minify/lines_output.js");

    Minify::setCache(null); // no cache
    
    $ret = Minify::serve('Files', array(
        'debug' => true
        ,'quiet' => true
        ,'encodeOutput' => false
        ,'files' => array(
            "{$thisDir}/_test_files/minify/email.js"
            ,"{$thisDir}/_test_files/minify/lines_bugs.js"
            ,"{$thisDir}/_test_files/minify/QueryString.js"
            ,"{$thisDir}/_test_files/js/before.js"
        )
    ));
    
    $passed = assertTrue($exp === $ret['content'], 'Minify_Lines');
        
    if (__FILE__ === realpath($_SERVER['SCRIPT_FILENAME'])) {
        echo "\n---Output: " .strlen($ret['content']). " bytes\n\n{$ret['content']}\n\n";
        if (!$passed) {
            echo "---Expected: " .strlen($exp). " bytes\n\n{$exp}\n\n\n";
        }
    }
}

test_Lines();