public function TranslatableMarkupTest::testIsStringAssertionWithFormattableMarkup in Drupal 10
Same name and namespace in other branches
- 8 core/tests/Drupal/Tests/Core/StringTranslation/TranslatableMarkupTest.php \Drupal\Tests\Core\StringTranslation\TranslatableMarkupTest::testIsStringAssertionWithFormattableMarkup()
- 9 core/tests/Drupal/Tests/Core/StringTranslation/TranslatableMarkupTest.php \Drupal\Tests\Core\StringTranslation\TranslatableMarkupTest::testIsStringAssertionWithFormattableMarkup()
@covers ::__construct
File
- core/
tests/ Drupal/ Tests/ Core/ StringTranslation/ TranslatableMarkupTest.php, line 97
Class
- TranslatableMarkupTest
- Tests the TranslatableMarkup class.
Namespace
Drupal\Tests\Core\StringTranslationCode
public function testIsStringAssertionWithFormattableMarkup() {
$formattable_string = new FormattableMarkup('@bar', [
'@bar' => 'foo',
]);
$this
->expectException(\InvalidArgumentException::class);
$this
->expectExceptionMessage('$string ("foo") must be a string.');
new TranslatableMarkup($formattable_string);
}