class AreaMessagesTest
Same name and namespace in other branches
- 11.x core/modules/views/tests/src/Kernel/Handler/AreaMessagesTest.php \Drupal\Tests\views\Kernel\Handler\AreaMessagesTest
- 10 core/modules/views/tests/src/Kernel/Handler/AreaMessagesTest.php \Drupal\Tests\views\Kernel\Handler\AreaMessagesTest
- 8.9.x core/modules/views/tests/src/Kernel/Handler/AreaMessagesTest.php \Drupal\Tests\views\Kernel\Handler\AreaMessagesTest
Tests the messages area handler.
@group views
Hierarchy
- class \Drupal\KernelTests\KernelTestBase implements \Drupal\Core\DependencyInjection\ServiceProviderInterface uses \Drupal\KernelTests\AssertLegacyTrait, \Drupal\KernelTests\AssertContentTrait, \Drupal\Tests\RandomGeneratorTrait, \Drupal\Tests\ConfigTestTrait, \Drupal\Tests\ExtensionListTestTrait, \Drupal\Tests\TestRequirementsTrait, \Drupal\Tests\Traits\PhpUnitWarnings, \Drupal\Tests\PhpUnitCompatibilityTrait, \Symfony\Bridge\PhpUnit\ExpectDeprecationTrait extends \PHPUnit\Framework\TestCase
- class \Drupal\Tests\views\Kernel\ViewsKernelTestBase uses \Drupal\views\Tests\ViewResultAssertionTrait extends \Drupal\KernelTests\KernelTestBase
- class \Drupal\Tests\views\Kernel\Handler\AreaMessagesTest extends \Drupal\Tests\views\Kernel\ViewsKernelTestBase
- class \Drupal\Tests\views\Kernel\ViewsKernelTestBase uses \Drupal\views\Tests\ViewResultAssertionTrait extends \Drupal\KernelTests\KernelTestBase
Expanded class hierarchy of AreaMessagesTest
See also
\Drupal\views\Plugin\views\area\Messages
File
-
core/
modules/ views/ tests/ src/ Kernel/ Handler/ AreaMessagesTest.php, line 14
Namespace
Drupal\Tests\views\Kernel\HandlerView source
class AreaMessagesTest extends ViewsKernelTestBase {
/**
* Views used by this test.
*
* @var array
*/
public static $testViews = [
'test_area_messages',
];
/**
* Tests the messages area handler.
*/
public function testMessageText() {
\Drupal::messenger()->addStatus('My drupal set message.');
$view = Views::getView('test_area_messages');
$view->setDisplay('default');
$this->executeView($view);
$output = $view->render();
$output = \Drupal::service('renderer')->renderRoot($output);
$this->setRawContent($output);
$this->assertText('My drupal set message.');
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.