@@ 2053-2079 (lines=27) @@ | ||
2050 | $this->assertEquals( $expected2, $actual2 ); |
|
2051 | } |
|
2052 | ||
2053 | public function test_html_minify_html_comments_inside_script_blocks_old_school_pattern() |
|
2054 | { |
|
2055 | $markup = <<<MARKUP |
|
2056 | <script> |
|
2057 | <!-- // invisible for old browsers |
|
2058 | var a = "z"; |
|
2059 | // --> |
|
2060 | </script> |
|
2061 | MARKUP; |
|
2062 | ||
2063 | $expected = <<<MARKUP |
|
2064 | <script>// invisible for old browsers |
|
2065 | var a = "z";</script> |
|
2066 | MARKUP; |
|
2067 | ||
2068 | $options = [ |
|
2069 | 'autoptimizeHTML' => [ |
|
2070 | 'keepcomments' => false, |
|
2071 | ], |
|
2072 | ]; |
|
2073 | ||
2074 | $instance = new autoptimizeHTML( $markup ); |
|
2075 | $instance->read( $options['autoptimizeHTML'] ); |
|
2076 | $instance->minify(); |
|
2077 | $actual = $instance->getcontent(); |
|
2078 | $this->assertEquals( $expected, $actual ); |
|
2079 | } |
|
2080 | ||
2081 | public function test_html_minify_html_comments_inside_script_blocks_old_school_pattern_untouched() |
|
2082 | { |
|
@@ 2081-2108 (lines=28) @@ | ||
2078 | $this->assertEquals( $expected, $actual ); |
|
2079 | } |
|
2080 | ||
2081 | public function test_html_minify_html_comments_inside_script_blocks_old_school_pattern_untouched() |
|
2082 | { |
|
2083 | $markup = <<<MARKUP |
|
2084 | <script> |
|
2085 | <!-- // invisible for old browsers |
|
2086 | var a = "z"; |
|
2087 | // --> |
|
2088 | </script> |
|
2089 | MARKUP; |
|
2090 | ||
2091 | $expected = <<<MARKUP |
|
2092 | <script><!-- // invisible for old browsers |
|
2093 | var a = "z"; |
|
2094 | // --></script> |
|
2095 | MARKUP; |
|
2096 | ||
2097 | $options = [ |
|
2098 | 'autoptimizeHTML' => [ |
|
2099 | 'keepcomments' => true, |
|
2100 | ], |
|
2101 | ]; |
|
2102 | ||
2103 | $instance = new autoptimizeHTML( $markup ); |
|
2104 | $instance->read( $options['autoptimizeHTML'] ); |
|
2105 | $instance->minify(); |
|
2106 | $actual = $instance->getcontent(); |
|
2107 | $this->assertEquals( $expected, $actual ); |
|
2108 | } |
|
2109 | ||
2110 | public function test_utils_mbstring_availabilty_overriding() |
|
2111 | { |