Skip to content

Commit

Permalink
Update tests to display muliple parser warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
ernilambar committed Jan 22, 2024
1 parent 6a7db80 commit 55274b5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

Contributors: plugin-check
Requires at least: 6.0
Tested up to: 6.1
Tested up to: Latest
Requires PHP: PHP 5.6
Stable tag: 1.0.0
License: GPLv2 or later
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,13 +233,15 @@ public function test_run_with_errors_parser_warnings() {

$this->assertNotEmpty( $warnings );
$this->assertArrayHasKey( 'readme.txt', $warnings );
$this->assertEquals( 1, $check_result->get_warning_count() );
$this->assertEquals( 2, $check_result->get_warning_count() );

// Check for parser warning.
// Check for parser warnings.
$this->assertArrayHasKey( 0, $warnings['readme.txt'] );
$this->assertArrayHasKey( 0, $warnings['readme.txt'][0] );
$this->assertArrayHasKey( 'code', $warnings['readme.txt'][0][0][0] );
$this->assertEquals( 'readme_parser_warnings', $warnings['readme.txt'][0][0][0]['code'] );
$this->assertArrayHasKey( 'code', $warnings['readme.txt'][0][0][1] );
$this->assertEquals( 'readme_parser_warnings', $warnings['readme.txt'][0][0][1]['code'] );
}

public function test_filter_readme_warnings_ignored() {
Expand Down Expand Up @@ -275,6 +277,7 @@ public function test_filter_wp_plugin_check_ignored_readme_warnings_will_return_
$custom_ignores = array(
'requires_php_header_ignored',
'contributor_ignored',
'tested_header_ignored',
);

// Create a mock filter that will return our custom ignores.
Expand Down

0 comments on commit 55274b5

Please sign in to comment.