public function DrupalSetMessageTest::testDrupalSetMessage in Zircon Profile 8
Same name in this branch
- 8 core/tests/Drupal/KernelTests/Core/Common/DrupalSetMessageTest.php \Drupal\KernelTests\Core\Common\DrupalSetMessageTest::testDrupalSetMessage()
- 8 core/modules/system/src/Tests/Bootstrap/DrupalSetMessageTest.php \Drupal\system\Tests\Bootstrap\DrupalSetMessageTest::testDrupalSetMessage()
Same name and namespace in other branches
- 8.0 core/tests/Drupal/KernelTests/Core/Common/DrupalSetMessageTest.php \Drupal\KernelTests\Core\Common\DrupalSetMessageTest::testDrupalSetMessage()
The basic functionality of drupal_set_message().
File
- core/
tests/ Drupal/ KernelTests/ Core/ Common/ DrupalSetMessageTest.php, line 21 - Contains \Drupal\KernelTests\Core\Common\DrupalSetMessageTest.
Class
- DrupalSetMessageTest
- @covers ::drupal_set_message @group PHPUnit
Namespace
Drupal\KernelTests\Core\CommonCode
public function testDrupalSetMessage() {
drupal_set_message(t('A message: @foo', [
'@foo' => 'bar',
]));
$messages = drupal_get_messages();
$this
->assertInstanceOf('Drupal\\Core\\Render\\Markup', $messages['status'][0]);
$this
->assertEquals('A message: bar', (string) $messages['status'][0]);
}