| @@ 2037-2063 (lines=27) @@ | ||
| 2034 | $this->assertEquals( $expected2, $actual2 ); |
|
| 2035 | } |
|
| 2036 | ||
| 2037 | public function test_html_minify_html_comments_inside_script_blocks_old_school_pattern() |
|
| 2038 | { |
|
| 2039 | $markup = <<<MARKUP |
|
| 2040 | <script> |
|
| 2041 | <!-- // invisible for old browsers |
|
| 2042 | var a = "z"; |
|
| 2043 | // --> |
|
| 2044 | </script> |
|
| 2045 | MARKUP; |
|
| 2046 | ||
| 2047 | $expected = <<<MARKUP |
|
| 2048 | <script>// invisible for old browsers |
|
| 2049 | var a = "z";</script> |
|
| 2050 | MARKUP; |
|
| 2051 | ||
| 2052 | $options = [ |
|
| 2053 | 'autoptimizeHTML' => [ |
|
| 2054 | 'keepcomments' => false, |
|
| 2055 | ], |
|
| 2056 | ]; |
|
| 2057 | ||
| 2058 | $instance = new autoptimizeHTML( $markup ); |
|
| 2059 | $instance->read( $options['autoptimizeHTML'] ); |
|
| 2060 | $instance->minify(); |
|
| 2061 | $actual = $instance->getcontent(); |
|
| 2062 | $this->assertEquals( $expected, $actual ); |
|
| 2063 | } |
|
| 2064 | ||
| 2065 | public function test_html_minify_html_comments_inside_script_blocks_old_school_pattern_untouched() |
|
| 2066 | { |
|
| @@ 2065-2092 (lines=28) @@ | ||
| 2062 | $this->assertEquals( $expected, $actual ); |
|
| 2063 | } |
|
| 2064 | ||
| 2065 | public function test_html_minify_html_comments_inside_script_blocks_old_school_pattern_untouched() |
|
| 2066 | { |
|
| 2067 | $markup = <<<MARKUP |
|
| 2068 | <script> |
|
| 2069 | <!-- // invisible for old browsers |
|
| 2070 | var a = "z"; |
|
| 2071 | // --> |
|
| 2072 | </script> |
|
| 2073 | MARKUP; |
|
| 2074 | ||
| 2075 | $expected = <<<MARKUP |
|
| 2076 | <script><!-- // invisible for old browsers |
|
| 2077 | var a = "z"; |
|
| 2078 | // --></script> |
|
| 2079 | MARKUP; |
|
| 2080 | ||
| 2081 | $options = [ |
|
| 2082 | 'autoptimizeHTML' => [ |
|
| 2083 | 'keepcomments' => true, |
|
| 2084 | ], |
|
| 2085 | ]; |
|
| 2086 | ||
| 2087 | $instance = new autoptimizeHTML( $markup ); |
|
| 2088 | $instance->read( $options['autoptimizeHTML'] ); |
|
| 2089 | $instance->minify(); |
|
| 2090 | $actual = $instance->getcontent(); |
|
| 2091 | $this->assertEquals( $expected, $actual ); |
|
| 2092 | } |
|
| 2093 | ||
| 2094 | public function test_utils_mbstring_availabilty_overriding() |
|
| 2095 | { |
|