Skip to content

Commit

Permalink
reverted tests and updated escaped default
Browse files Browse the repository at this point in the history
  • Loading branch information
davidperezgar committed Dec 6, 2024
1 parent c5e3bdc commit 2ce79b0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion includes/Checker/Checks/General/I18n_Usage_Check.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public function get_documentation_url(): string {
*/
protected function add_result_message_for_file( Check_Result $result, $error, $message, $code, $file, $line = 0, $column = 0, string $docs = '', $severity = 5 ) {
// Downgrade errors about usage of the 'default' text domain from WordPress Core to warnings.
if ( $error && str_ends_with( $message, " but got 'default'." ) ) {
if ( $error && str_ends_with( $message, " but got 'default'." ) ) {
$error = false;
}

Expand Down
6 changes: 3 additions & 3 deletions tests/phpunit/tests/Checker/Checks/I18n_Usage_Check_Tests.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ public function test_run_without_default_textdomain() {

// Explicitly using the 'default' text domain is a warning, omitting a text domain is an error.
$this->assertNotEmpty( $check_result->get_errors() );
$this->assertEmpty( $check_result->get_warnings() );
$this->assertEquals( 2, $check_result->get_error_count() );
$this->assertEquals( 0, $check_result->get_warning_count() );
$this->assertNotEmpty( $check_result->get_warnings() );
$this->assertEquals( 1, $check_result->get_error_count() );
$this->assertEquals( 1, $check_result->get_warning_count() );
}
}

0 comments on commit 2ce79b0

Please sign in to comment.