
| Current Path : /var/www/html/rocksensor1/web/core/modules/views/tests/src/Kernel/Handler/ |
Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 |
| Current File : /var/www/html/rocksensor1/web/core/modules/views/tests/src/Kernel/Handler/AreaMessagesTest.php |
<?php
declare(strict_types=1);
namespace Drupal\Tests\views\Kernel\Handler;
use Drupal\Tests\views\Kernel\ViewsKernelTestBase;
use Drupal\views\Views;
/**
* Tests the messages area handler.
*
* @group views
* @see \Drupal\views\Plugin\views\area\Messages
*/
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(): void {
\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.');
}
}