Skip to content

Commit

Permalink
simplify path regex
Browse files Browse the repository at this point in the history
  • Loading branch information
lekoala authored Jan 10, 2025
1 parent 9b46703 commit 4eeb5b9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/php/i18n/YamlReaderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ public function testThrowsMeaningfulExceptionWhenYmlIsCorrupted()
{
$path = __DIR__ . '/i18nTest/_fakewebroot/i18ntestmodule/lang/en_corrupt.yml';
$this->expectException(InvalidResourceException::class);
$regex_path = str_replace('.', '\.', $path ?? '');
$this->expectExceptionMessageMatches('@^Error parsing YAML, invalid file "' . $regex_path . '"\. Message: ([\w ].*) line 5 @');
// Error parsing YAML, invalid file "...\tests\php\i18n/i18nTest/_fakewebroot/i18ntestmodule/lang/en_corrupt.yml". Message: A colon cannot be used in an unquoted mapping value at line 5 (near " - Invalid # this should throw "A colon cannot be used in an unquoted mapping value at line 5"").
$this->expectExceptionMessageMatches('@^Error parsing YAML, invalid file \".*en_corrupt\.yml\"\. Message: ([\w ].*) line 5 @');
$reader = new YamlReader();
$reader->read('en', $path);
}
Expand Down

0 comments on commit 4eeb5b9

Please sign in to comment.