@@ -272,6 +272,8 @@ public function test_run_with_errors_tested_upto_minor_different_major_version()
272272 }
273273
274274 public function test_run_with_errors_missing_readme_headers () {
275+ add_filter ( 'wp_plugin_check_ignored_readme_warnings ' , '__return_empty_array ' );
276+
275277 $ readme_check = new Plugin_Readme_Check ();
276278 $ check_context = new Check_Context ( UNIT_TESTS_PLUGIN_DIR . 'test-plugin-plugin-readme-errors-upgrade-notice/load.php ' );
277279 $ check_result = new Check_Result ( $ check_context );
@@ -280,11 +282,20 @@ public function test_run_with_errors_missing_readme_headers() {
280282
281283 $ errors = $ check_result ->get_errors ();
282284
285+ remove_filter ( 'wp_plugin_check_ignored_readme_warnings ' , '__return_empty_array ' );
286+
283287 $ this ->assertNotEmpty ( $ errors );
284288 $ this ->assertArrayHasKey ( 'readme.txt ' , $ errors );
285289
286290 // Check for missing tested upto header.
287- $ this ->assertCount ( 1 , wp_list_filter ( $ errors ['readme.txt ' ][0 ][0 ], array ( 'code ' => 'missing_readme_header_tested ' ) ) );
291+ $ tested_upto_error = array_values ( wp_list_filter ( $ errors ['readme.txt ' ][0 ][0 ], array ( 'code ' => 'missing_readme_header_tested ' ) ) );
292+ $ this ->assertCount ( 1 , $ tested_upto_error );
293+ $ this ->assertSame ( 7 , $ tested_upto_error [0 ]['severity ' ] );
294+
295+ // Check for missing contributors header.
296+ $ contributors_error = array_values ( wp_list_filter ( $ errors ['readme.txt ' ][0 ][0 ], array ( 'code ' => 'missing_readme_header_contributors ' ) ) );
297+ $ this ->assertCount ( 1 , $ contributors_error );
298+ $ this ->assertSame ( 7 , $ contributors_error [0 ]['severity ' ] );
288299 }
289300
290301 public function test_run_md_with_errors () {
0 commit comments