1111
1212/**
1313 * Test Surge integration.
14+ *
15+ * @group integration
16+ * @coversDefaultClass \Activitypub\Integration\Surge
1417 */
1518class Test_Surge extends \WP_UnitTestCase {
1619 /**
@@ -21,11 +24,11 @@ class Test_Surge extends \WP_UnitTestCase {
2124 private $ test_file ;
2225
2326 /**
24- * Original config file path .
27+ * Config contents .
2528 *
2629 * @var string
2730 */
28- private $ original_config_file ;
31+ private $ config_contents ;
2932
3033 /**
3134 * Original cache config.
@@ -83,7 +86,7 @@ public function test_add_cache_config() {
8386
8487 $ this ->assertStringContainsString ( '<?php ' , $ file , 'File should start with PHP opening tag ' );
8588 $ this ->assertStringContainsString ( "/* That's all, stop editing! */ " , $ file , 'Comment should be present ' );
86- $ this ->assertStringContainsString ( Surge::$ cache_config , $ file , 'Config line should be present ' );
89+ $ this ->assertStringContainsString ( Surge::get_cache_config () , $ file , 'Config line should be present ' );
8790 }
8891
8992 /**
@@ -101,7 +104,7 @@ public function test_remove_cache_config() {
101104 // phpcs:ignore
102105 $ actual = \file_get_contents ( Surge::get_config_file_path () );
103106 $ this ->assertStringContainsString ( '<?php ' , $ actual , 'File should start with PHP opening tag ' );
104- $ this ->assertStringNotContainsString ( Surge::$ cache_config , $ actual , 'Config line should be removed ' );
107+ $ this ->assertStringNotContainsString ( Surge::get_cache_config () , $ actual , 'Config line should be removed ' );
105108 $ this ->assertStringContainsString ( "/* That's all, stop editing! */ " , $ actual , 'Comment should be present ' );
106109 }
107110
@@ -115,7 +118,7 @@ public function test_init_with_surge_active() {
115118
116119 // phpcs:ignore
117120 $ before = \file_get_contents ( Surge::get_config_file_path () );
118- $ this ->assertStringNotContainsString ( Surge::$ cache_config , $ before );
121+ $ this ->assertStringNotContainsString ( Surge::get_cache_config () , $ before );
119122
120123 Surge::init ();
121124
@@ -124,7 +127,7 @@ public function test_init_with_surge_active() {
124127
125128 // phpcs:ignore
126129 $ after = \file_get_contents ( Surge::get_config_file_path () );
127- $ this ->assertStringContainsString ( Surge::$ cache_config , $ after );
130+ $ this ->assertStringContainsString ( Surge::get_cache_config () , $ after );
128131
129132 \remove_all_filters ( 'pre_option_active_plugins ' );
130133 }
@@ -145,7 +148,7 @@ public function get_active_plugins() {
145148 */
146149 public function test_init_with_surge_inactive () {
147150 // phpcs:ignore
148- \file_put_contents ( Surge::get_config_file_path (), "<?php \n" . Surge::$ cache_config . "\n\n/* That's all, stop editing! */ " );
151+ \file_put_contents ( Surge::get_config_file_path (), "<?php \n" . Surge::get_cache_config () . "\n\n/* That's all, stop editing! */ " );
149152 \add_filter ( 'pre_option_active_plugins ' , array ( $ this , 'get_inactive_plugins ' ) );
150153
151154 Surge::init ();
@@ -155,7 +158,7 @@ public function test_init_with_surge_inactive() {
155158
156159 // phpcs:ignore
157160 $ after = \file_get_contents ( Surge::get_config_file_path () );
158- $ this ->assertStringNotContainsString ( Surge::$ cache_config , $ after );
161+ $ this ->assertStringNotContainsString ( Surge::get_cache_config () , $ after );
159162
160163 \remove_all_filters ( 'pre_option_active_plugins ' );
161164 }
0 commit comments