Skip to content

Commit 90a6da0

Browse files
committed
Make check for requires headers an error
1 parent d528d19 commit 90a6da0

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

includes/Checker/Checks/Plugin_Repo/Plugin_Readme_Check.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -835,7 +835,7 @@ private function check_requires_headers( Check_Result $result, string $readme_fi
835835
$plugin_value = $plugin_data[ $requires[ $require ]['header_field'] ];
836836

837837
if ( $readme_value !== $plugin_value ) {
838-
$this->add_result_warning_for_file(
838+
$this->add_result_error_for_file(
839839
$result,
840840
sprintf(
841841
/* translators: 1: readme header tag, 2: versions comparison */
@@ -847,8 +847,7 @@ private function check_requires_headers( Check_Result $result, string $readme_fi
847847
$readme_file,
848848
0,
849849
0,
850-
'https://developer.wordpress.org/plugins/wordpress-org/how-your-readme-txt-works/#readme-header-information',
851-
6
850+
'https://developer.wordpress.org/plugins/wordpress-org/how-your-readme-txt-works/#readme-header-information'
852851
);
853852
}
854853
}

tests/phpunit/tests/Checker/Checks/Plugin_Readme_Check_Tests.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -549,12 +549,12 @@ public function test_run_with_mismatched_requires_headers() {
549549

550550
$check->run( $check_result );
551551

552-
$warnings = $check_result->get_warnings();
552+
$errors = $check_result->get_errors();
553553

554-
$this->assertNotEmpty( $warnings );
555-
$this->assertArrayHasKey( 'readme.txt', $warnings );
554+
$this->assertNotEmpty( $errors );
555+
$this->assertArrayHasKey( 'readme.txt', $errors );
556556

557-
$this->assertCount( 1, wp_list_filter( $warnings['readme.txt'][0][0], array( 'code' => 'readme_mismatched_header_requires' ) ) );
558-
$this->assertCount( 1, wp_list_filter( $warnings['readme.txt'][0][0], array( 'code' => 'readme_mismatched_header_requires_php' ) ) );
557+
$this->assertCount( 1, wp_list_filter( $errors['readme.txt'][0][0], array( 'code' => 'readme_mismatched_header_requires' ) ) );
558+
$this->assertCount( 1, wp_list_filter( $errors['readme.txt'][0][0], array( 'code' => 'readme_mismatched_header_requires_php' ) ) );
559559
}
560560
}

0 commit comments

Comments
 (0)