@@ 2778-2792 (lines=15) @@ | ||
2775 | /** |
|
2776 | * Test network vs site settings: network only. |
|
2777 | */ |
|
2778 | public function test_network_no_site_settings() |
|
2779 | { |
|
2780 | if ( is_multisite() ) { |
|
2781 | define( 'TEST_MULTISITE_FORCE_AO_ON_NETWORK', true ); |
|
2782 | // set options through WordPress core methods. |
|
2783 | update_option( 'autoptimize_js_exclude', 'site' ); |
|
2784 | update_network_option( get_main_network_id(), 'autoptimize_js_exclude', 'network' ); |
|
2785 | update_network_option( get_main_network_id(), 'autoptimize_enable_site_config', '' ); |
|
2786 | ||
2787 | // and then try fetching them through optionwrapper. |
|
2788 | $expected = 'network'; |
|
2789 | $actual = autoptimizeOptionWrapper::get_option( 'autoptimize_js_exclude' ); |
|
2790 | $this->assertEquals( $expected, $actual ); |
|
2791 | } |
|
2792 | } |
|
2793 | ||
2794 | /** |
|
2795 | * Test network vs site settings; per site. |
|
@@ 2797-2811 (lines=15) @@ | ||
2794 | /** |
|
2795 | * Test network vs site settings; per site. |
|
2796 | */ |
|
2797 | public function test_network_per_site_settings() |
|
2798 | { |
|
2799 | if ( is_multisite() ) { |
|
2800 | // define of TEST_MULTISITE_FORCE_AO_ON_NETWORK not needed, done in previous test. |
|
2801 | // set options through WordPress core methods. |
|
2802 | update_option( 'autoptimize_js_exclude', 'site' ); |
|
2803 | update_network_option( get_main_network_id(), 'autoptimize_js_exclude', 'network' ); |
|
2804 | update_network_option( get_main_network_id(), 'autoptimize_enable_site_config', 'on' ); |
|
2805 | ||
2806 | // and then try fetching them through optionwrapper. |
|
2807 | $expected = 'site'; |
|
2808 | $actual = autoptimizeOptionWrapper::get_option( 'autoptimize_js_exclude' ); |
|
2809 | $this->assertEquals( $expected, $actual ); |
|
2810 | } |
|
2811 | } |
|
2812 | } |
|
2813 |