.../KernelTests/Core/Common/DrupalSetMessageLoadsCssTest.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/core/tests/Drupal/KernelTests/Core/Common/DrupalSetMessageLoadsCssTest.php b/core/tests/Drupal/KernelTests/Core/Common/DrupalSetMessageLoadsCssTest.php index f592237..4fdced1 100644 --- a/core/tests/Drupal/KernelTests/Core/Common/DrupalSetMessageLoadsCssTest.php +++ b/core/tests/Drupal/KernelTests/Core/Common/DrupalSetMessageLoadsCssTest.php @@ -7,6 +7,7 @@ namespace Drupal\KernelTests\Core\Common; +use Drupal\Core\Url; use Drupal\simpletest\WebTestBase; /** @@ -17,9 +18,15 @@ class DrupalSetMessageLoadsCssTest extends WebTestBase { /** + * {@inheritdoc} + */ + public static $modules = ['session_test']; + + /** * Check that a page does not load message assets when unrequired. */ public function testDrupalSetMessage() { + $this->drupalLogin($this->rootUser); // Test with aggregated CSS turned off. $config = $this->config('system.performance'); @@ -34,7 +41,7 @@ public function testDrupalSetMessage() { $this->assertNoRaw("core/themes/classy/css/components/messages.css", "Message CSS assets should not be loaded when not needed."); // Display a message. - drupal_set_message(t('A status message.')); + $this->drupalGet(Url::fromRoute('session_test.set_message')); // Get the frontpage. $this->drupalGet("");