@@ -153,13 +153,17 @@ public function test_register_async_test_endpoints() {
153
153
*/
154
154
public function test_add_tests () {
155
155
$ tests = $ this ->instance ->add_tests ( [] );
156
+
156
157
$ this ->assertArrayHasKey ( 'direct ' , $ tests );
157
- $ this ->assertArrayHasKey ( 'amp_persistent_object_cache ' , $ tests ['direct ' ] );
158
158
159
- if ( version_compare ( get_bloginfo ( 'version ' ), '5.6 ' , '>= ' ) ) {
160
- $ this ->assertArrayHasKey ( 'amp_page_cache ' , $ tests ['async ' ] );
161
- } elseif ( array_key_exists ( 'async ' , $ tests ) ) {
162
- $ this ->assertArrayNotHasKey ( 'amp_page_cache ' , $ tests ['async ' ] );
159
+ if ( ! version_compare ( get_bloginfo ( 'version ' ), '6.1 ' , '>= ' ) ) {
160
+ $ this ->assertArrayHasKey ( 'amp_persistent_object_cache ' , $ tests ['direct ' ] );
161
+
162
+ if ( version_compare ( get_bloginfo ( 'version ' ), '5.6 ' , '>= ' ) ) {
163
+ $ this ->assertArrayHasKey ( 'amp_page_cache ' , $ tests ['async ' ] );
164
+ } elseif ( array_key_exists ( 'async ' , $ tests ) ) {
165
+ $ this ->assertArrayNotHasKey ( 'amp_page_cache ' , $ tests ['async ' ] );
166
+ }
163
167
}
164
168
165
169
$ this ->assertArrayHasKey ( 'amp_curl_multi_functions ' , $ tests ['direct ' ] );
@@ -698,6 +702,10 @@ public function test_add_extensions() {
698
702
* @covers ::get_good_response_time_threshold()
699
703
*/
700
704
public function test_get_good_response_time_threshold () {
705
+ if ( version_compare ( get_bloginfo ( 'version ' ), '6.1 ' , '>= ' ) ) {
706
+ $ this ->markTestSkipped ( '`amp_page_cache_good_response_time_threshold` is deprecated in WordPress 6.1 and above. ' );
707
+ }
708
+
701
709
$ this ->assertSame ( 600 , $ this ->instance ->get_good_response_time_threshold () );
702
710
703
711
add_filter (
@@ -918,6 +926,9 @@ public function get_page_cache_data() {
918
926
* @covers ::check_for_page_caching()
919
927
*/
920
928
public function test_page_cache ( $ responses , $ expected_status , $ expected_label , $ good_basic_auth = null , $ delay_the_response = false ) {
929
+ if ( version_compare ( get_bloginfo ( 'version ' ), '6.1 ' , '>= ' ) ) {
930
+ $ this ->markTestSkipped ( 'AMP plugin omits page and object caching tests for Site Health if on WP>=6.1 ' );
931
+ }
921
932
922
933
$ badge_color = [
923
934
'critical ' => 'red ' ,
0 commit comments