Code Duplication    Length = 17-17 lines in 2 locations

tests/test-ao.php 2 locations

@@ 2845-2861 (lines=17) @@
2842
    /**
2843
     * Test network vs site settings: network only.
2844
     */
2845
    public function test_network_no_site_settings()
2846
    {
2847
        if ( is_multisite() ) {
2848
            define( 'TEST_MULTISITE_FORCE_AO_ON_NETWORK', true );
2849
            // set options through WordPress core methods.
2850
            update_option( 'autoptimize_js_exclude', 'site' );
2851
            update_network_option( get_main_network_id(), 'autoptimize_js_exclude', 'network' );
2852
            update_network_option( get_main_network_id(), 'autoptimize_enable_site_config', '' );
2853
2854
            // and then try fetching them through optionwrapper.
2855
            $expected = 'network';
2856
            $actual   = autoptimizeOptionWrapper::get_option( 'autoptimize_js_exclude' );
2857
            $this->assertEquals( $expected, $actual );
2858
        } else {
2859
            $this->assertEquals( 1, 1 ); // just to ensure this isn't marked as a risky test.
2860
        }
2861
    }
2862
2863
    /**
2864
     * Test network vs site settings; per site.
@@ 2866-2882 (lines=17) @@
2863
    /**
2864
     * Test network vs site settings; per site.
2865
     */
2866
    public function test_network_per_site_settings()
2867
    {
2868
        if ( is_multisite() ) {
2869
            // define of TEST_MULTISITE_FORCE_AO_ON_NETWORK not needed, done in previous test.
2870
            // set options through WordPress core methods.
2871
            update_option( 'autoptimize_js_exclude', 'site' );
2872
            update_network_option( get_main_network_id(), 'autoptimize_js_exclude', 'network' );
2873
            update_network_option( get_main_network_id(), 'autoptimize_enable_site_config', 'on' );
2874
2875
            // and then try fetching them through optionwrapper.
2876
            $expected = 'site';
2877
            $actual   = autoptimizeOptionWrapper::get_option( 'autoptimize_js_exclude' );
2878
            $this->assertEquals( $expected, $actual );
2879
        } else {
2880
            $this->assertEquals( 1, 1 ); // just to ensure this isn't marked as a risky test.
2881
        }
2882
    }
2883
}
2884