Code Duplication    Length = 16-36 lines in 2 locations

tests/test-ao.php 2 locations

@@ 604-639 (lines=36) @@
601
        $this->assertEquals( $css_expected, $css_actual );
602
    }
603
604
    public function test_default_cssmin_minifier()
605
    {
606
        $css = <<<CSS
607
.bg { background:url('img/something.svg'); }
608
.bg-no-quote { background: url(img/something.svg); }
609
.bg-double-quotes { background: url("img/something.svg"); }
610
611
.whitespaces { background : url   (  "../../somewhere-else/svg.svg" ) ; }
612
613
.host-relative { background: url("/img/something.svg"); }
614
.protocol-relative { background: url("//something/somewhere/example.png"); }
615
616
/* roboto-100 - latin-ext_latin */
617
@font-face {
618
  font-family: 'Roboto';
619
  font-style: normal;
620
  font-weight: 100;
621
  src: url(../fonts/roboto-v15-latin-ext_latin-100.eot); /* IE9 Compat Modes */
622
  src: local('Roboto Thin'), local('Roboto-Thin'),
623
       url(../fonts/roboto-v15-latin-ext_latin-100.eot?#iefix) format('embedded-opentype'), /* IE6-IE8 */
624
       url(../fonts/roboto-v15-latin-ext_latin-100.woff2) format('woff2'), /* Super Modern Browsers */
625
       url(../fonts/roboto-v15-latin-ext_latin-100.woff) format('woff'), /* Modern Browsers */
626
       url(../fonts/roboto-v15-latin-ext_latin-100.ttf) format('truetype'), /* Safari, Android, iOS */
627
       url(../fonts/roboto-v15-latin-ext_latin-100.svg#Roboto) format('svg'); /* Legacy iOS */
628
}
629
CSS;
630
631
        $expected = <<<CSS
632
.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')}
633
CSS;
634
635
        $instance = new autoptimizeStyles( $css );
636
        $minified = $instance->run_minifier_on( $css );
637
638
        $this->assertEquals( $expected, $minified );
639
    }
640
641
    /**
642
     * @dataProvider provider_test_should_aggregate_script_types
@@ 2670-2685 (lines=16) @@
2667
        ];
2668
    }
2669
2670
    public function test_css_minifier_unmatched_parens()
2671
    {
2672
        $css = <<<MARKUP
2673
img.centered, .aligncenter {
2674
    -webkit-box-shadow: none;
2675
    -moz-box-shadow: none;
2676
    box-shadow: none;
2677
MARKUP;
2678
2679
        $expected = 'img.centered,.aligncenter{-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}';
2680
2681
        $instance = new autoptimizeStyles( $css );
2682
        $minified = $instance->run_minifier_on( $css );
2683
2684
        $this->assertEquals( $expected, $minified );
2685
    }
2686
2687
    public function test_css_font_names_mangling()
2688
    {