public function AjaxCommandsTest::testAnnounceCommand in Drupal 8
Same name and namespace in other branches
- 9 core/tests/Drupal/Tests/Core/Ajax/AjaxCommandsTest.php \Drupal\Tests\Core\Ajax\AjaxCommandsTest::testAnnounceCommand()
- 10 core/tests/Drupal/Tests/Core/Ajax/AjaxCommandsTest.php \Drupal\Tests\Core\Ajax\AjaxCommandsTest::testAnnounceCommand()
@covers \Drupal\Core\Ajax\AnnounceCommand
@dataProvider announceCommandProvider
File
- core/
tests/ Drupal/ Tests/ Core/ Ajax/ AjaxCommandsTest.php, line 88
Class
- AjaxCommandsTest
- Test coverage for various classes in the \Drupal\Core\Ajax namespace.
Namespace
Drupal\Tests\Core\AjaxCode
public function testAnnounceCommand($message, $priority, array $expected) {
if ($priority === NULL) {
$command = new AnnounceCommand($message);
}
else {
$command = new AnnounceCommand($message, $priority);
}
$expected_assets = new AttachedAssets();
$expected_assets
->setLibraries([
'core/drupal.announce',
]);
$this
->assertEquals($expected_assets, $command
->getAttachedAssets());
$this
->assertSame($expected, $command
->render());
}