function TranslatableMarkupTest::testIsStringAssertion
Same name in other branches
- 9 core/tests/Drupal/Tests/Core/StringTranslation/TranslatableMarkupTest.php \Drupal\Tests\Core\StringTranslation\TranslatableMarkupTest::testIsStringAssertion()
- 8.9.x core/tests/Drupal/Tests/Core/StringTranslation/TranslatableMarkupTest.php \Drupal\Tests\Core\StringTranslation\TranslatableMarkupTest::testIsStringAssertion()
- 10 core/tests/Drupal/Tests/Core/StringTranslation/TranslatableMarkupTest.php \Drupal\Tests\Core\StringTranslation\TranslatableMarkupTest::testIsStringAssertion()
@covers ::__construct
File
-
core/
tests/ Drupal/ Tests/ Core/ StringTranslation/ TranslatableMarkupTest.php, line 89
Class
- TranslatableMarkupTest
- Tests the TranslatableMarkup class.
Namespace
Drupal\Tests\Core\StringTranslationCode
public function testIsStringAssertion() : void {
$translation = $this->getStringTranslationStub();
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage('$string ("foo") must be a string.');
new TranslatableMarkup(new TranslatableMarkup('foo', [], [], $translation));
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.