Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

qa: Use less-specific exception message assertion in StringFormatterTest #412

Merged
merged 1 commit into from
Aug 22, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions tests/Unit/Utility/String/StringFormatterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ final class StringFormatterTest extends TestCase
public function test_wrong_intl_format_throws_exception(): void
{
$this->expectException(StringFormatterError::class);
$this->expectExceptionMessage('Message formatter error using `some {wrong.format}`: pattern syntax error (parse error at offset 6, after "some {", before or at "wrong.format}"): U_PATTERN_SYNTAX_ERROR.');
$this->expectExceptionMessage('Message formatter error using `some {wrong.format}`');
$this->expectExceptionCode(1652901203);

StringFormatter::format('en', 'some {wrong.format}', []);
Expand All @@ -26,7 +26,7 @@ public function test_wrong_intl_format_throws_exception(): void
public function test_wrong_message_body_format_throws_exception(): void
{
$this->expectException(StringFormatterError::class);
$this->expectExceptionMessage('Message formatter error using `some message with {invalid format}`: pattern syntax error (parse error at offset 19, after " message with {", before or at "invalid format}"): U_PATTERN_SYNTAX_ERROR.');
$this->expectExceptionMessage('Message formatter error using `some message with {invalid format}`');
$this->expectExceptionCode(1652901203);

StringFormatter::format('en', 'some message with {invalid format}');
Expand Down