@@ 615-650 (lines=36) @@ | ||
612 | $this->assertEquals( $css_expected, $css_actual ); |
|
613 | } |
|
614 | ||
615 | public function test_default_cssmin_minifier() |
|
616 | { |
|
617 | $css = <<<CSS |
|
618 | .bg { background:url('img/something.svg'); } |
|
619 | .bg-no-quote { background: url(img/something.svg); } |
|
620 | .bg-double-quotes { background: url("img/something.svg"); } |
|
621 | ||
622 | .whitespaces { background : url ( "../../somewhere-else/svg.svg" ) ; } |
|
623 | ||
624 | .host-relative { background: url("/img/something.svg"); } |
|
625 | .protocol-relative { background: url("//something/somewhere/example.png"); } |
|
626 | ||
627 | /* roboto-100 - latin-ext_latin */ |
|
628 | @font-face { |
|
629 | font-family: 'Roboto'; |
|
630 | font-style: normal; |
|
631 | font-weight: 100; |
|
632 | src: url(../fonts/roboto-v15-latin-ext_latin-100.eot); /* IE9 Compat Modes */ |
|
633 | src: local('Roboto Thin'), local('Roboto-Thin'), |
|
634 | url(../fonts/roboto-v15-latin-ext_latin-100.eot?#iefix) format('embedded-opentype'), /* IE6-IE8 */ |
|
635 | url(../fonts/roboto-v15-latin-ext_latin-100.woff2) format('woff2'), /* Super Modern Browsers */ |
|
636 | url(../fonts/roboto-v15-latin-ext_latin-100.woff) format('woff'), /* Modern Browsers */ |
|
637 | url(../fonts/roboto-v15-latin-ext_latin-100.ttf) format('truetype'), /* Safari, Android, iOS */ |
|
638 | url(../fonts/roboto-v15-latin-ext_latin-100.svg#Roboto) format('svg'); /* Legacy iOS */ |
|
639 | } |
|
640 | CSS; |
|
641 | ||
642 | $expected = <<<CSS |
|
643 | .bg{background:url('img/something.svg')}.bg-no-quote{background:url(img/something.svg)}.bg-double-quotes{background:url("img/something.svg")}.whitespaces{background:url ("../../somewhere-else/svg.svg")}.host-relative{background:url("/img/something.svg")}.protocol-relative{background:url("//something/somewhere/example.png")}@font-face{font-family:'Roboto';font-style:normal;font-weight:100;src:url(../fonts/roboto-v15-latin-ext_latin-100.eot);src:local('Roboto Thin'),local('Roboto-Thin'),url(../fonts/roboto-v15-latin-ext_latin-100.eot?#iefix) format('embedded-opentype'),url(../fonts/roboto-v15-latin-ext_latin-100.woff2) format('woff2'),url(../fonts/roboto-v15-latin-ext_latin-100.woff) format('woff'),url(../fonts/roboto-v15-latin-ext_latin-100.ttf) format('truetype'),url(../fonts/roboto-v15-latin-ext_latin-100.svg#Roboto) format('svg')} |
|
644 | CSS; |
|
645 | ||
646 | $instance = new autoptimizeStyles( $css ); |
|
647 | $minified = $instance->run_minifier_on( $css ); |
|
648 | ||
649 | $this->assertEquals( $expected, $minified ); |
|
650 | } |
|
651 | ||
652 | /** |
|
653 | * @dataProvider provider_test_should_aggregate_script_types |
|
@@ 2716-2731 (lines=16) @@ | ||
2713 | ]; |
|
2714 | } |
|
2715 | ||
2716 | public function test_css_minifier_unmatched_parens() |
|
2717 | { |
|
2718 | $css = <<<MARKUP |
|
2719 | img.centered, .aligncenter { |
|
2720 | -webkit-box-shadow: none; |
|
2721 | -moz-box-shadow: none; |
|
2722 | box-shadow: none; |
|
2723 | MARKUP; |
|
2724 | ||
2725 | $expected = 'img.centered,.aligncenter{-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}'; |
|
2726 | ||
2727 | $instance = new autoptimizeStyles( $css ); |
|
2728 | $minified = $instance->run_minifier_on( $css ); |
|
2729 | ||
2730 | $this->assertEquals( $expected, $minified ); |
|
2731 | } |
|
2732 | ||
2733 | public function test_css_font_names_mangling() |
|
2734 | { |