Code Duplication    Length = 16-36 lines in 2 locations

tests/test-ao.php 2 locations

@@ 601-636 (lines=36) @@
598
        $this->assertEquals( $css_expected, $css_actual );
599
    }
600
601
    public function test_default_cssmin_minifier()
602
    {
603
        $css = <<<CSS
604
.bg { background:url('img/something.svg'); }
605
.bg-no-quote { background: url(img/something.svg); }
606
.bg-double-quotes { background: url("img/something.svg"); }
607
608
.whitespaces { background : url   (  "../../somewhere-else/svg.svg" ) ; }
609
610
.host-relative { background: url("/img/something.svg"); }
611
.protocol-relative { background: url("//something/somewhere/example.png"); }
612
613
/* roboto-100 - latin-ext_latin */
614
@font-face {
615
  font-family: 'Roboto';
616
  font-style: normal;
617
  font-weight: 100;
618
  src: url(../fonts/roboto-v15-latin-ext_latin-100.eot); /* IE9 Compat Modes */
619
  src: local('Roboto Thin'), local('Roboto-Thin'),
620
       url(../fonts/roboto-v15-latin-ext_latin-100.eot?#iefix) format('embedded-opentype'), /* IE6-IE8 */
621
       url(../fonts/roboto-v15-latin-ext_latin-100.woff2) format('woff2'), /* Super Modern Browsers */
622
       url(../fonts/roboto-v15-latin-ext_latin-100.woff) format('woff'), /* Modern Browsers */
623
       url(../fonts/roboto-v15-latin-ext_latin-100.ttf) format('truetype'), /* Safari, Android, iOS */
624
       url(../fonts/roboto-v15-latin-ext_latin-100.svg#Roboto) format('svg'); /* Legacy iOS */
625
}
626
CSS;
627
628
        $expected = <<<CSS
629
.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')}
630
CSS;
631
632
        $instance = new autoptimizeStyles( $css );
633
        $minified = $instance->run_minifier_on( $css );
634
635
        $this->assertEquals( $expected, $minified );
636
    }
637
638
    /**
639
     * @dataProvider provider_test_should_aggregate_script_types
@@ 2403-2418 (lines=16) @@
2400
        ];
2401
    }
2402
2403
    public function test_css_minifier_unmatched_parens()
2404
    {
2405
        $css = <<<MARKUP
2406
img.centered, .aligncenter {
2407
    -webkit-box-shadow: none;
2408
    -moz-box-shadow: none;
2409
    box-shadow: none;
2410
MARKUP;
2411
2412
        $expected = 'img.centered,.aligncenter{-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}';
2413
2414
        $instance = new autoptimizeStyles( $css );
2415
        $minified = $instance->run_minifier_on( $css );
2416
2417
        $this->assertEquals( $expected, $minified );
2418
    }
2419
2420
    public function test_css_font_names_mangling()
2421
    {