@@ 2755-2769 (lines=15) @@ | ||
2752 | /** |
|
2753 | * Test network vs site settings: network only. |
|
2754 | */ |
|
2755 | public function test_network_no_site_settings() |
|
2756 | { |
|
2757 | if ( is_multisite() ) { |
|
2758 | define( 'TEST_MULTISITE_FORCE_AO_ON_NETWORK', true ); |
|
2759 | // set options through WordPress core methods. |
|
2760 | update_option( 'autoptimize_js_exclude', 'site' ); |
|
2761 | update_network_option( get_main_network_id(), 'autoptimize_js_exclude', 'network' ); |
|
2762 | update_network_option( get_main_network_id(), 'autoptimize_enable_site_config', '' ); |
|
2763 | ||
2764 | // and then try fetching them through optionwrapper. |
|
2765 | $expected = 'network'; |
|
2766 | $actual = autoptimizeOptionWrapper::get_option( 'autoptimize_js_exclude' ); |
|
2767 | $this->assertEquals( $expected, $actual ); |
|
2768 | } |
|
2769 | } |
|
2770 | ||
2771 | /** |
|
2772 | * Test network vs site settings; per site. |
|
@@ 2774-2788 (lines=15) @@ | ||
2771 | /** |
|
2772 | * Test network vs site settings; per site. |
|
2773 | */ |
|
2774 | public function test_network_per_site_settings() |
|
2775 | { |
|
2776 | if ( is_multisite() ) { |
|
2777 | // define of TEST_MULTISITE_FORCE_AO_ON_NETWORK not needed, done in previous test. |
|
2778 | // set options through WordPress core methods. |
|
2779 | update_option( 'autoptimize_js_exclude', 'site' ); |
|
2780 | update_network_option( get_main_network_id(), 'autoptimize_js_exclude', 'network' ); |
|
2781 | update_network_option( get_main_network_id(), 'autoptimize_enable_site_config', 'on' ); |
|
2782 | ||
2783 | // and then try fetching them through optionwrapper. |
|
2784 | $expected = 'site'; |
|
2785 | $actual = autoptimizeOptionWrapper::get_option( 'autoptimize_js_exclude' ); |
|
2786 | $this->assertEquals( $expected, $actual ); |
|
2787 | } |
|
2788 | } |
|
2789 | } |
|
2790 |