function ErrorHandlerTest::assertNoMessages

Same name and namespace in other branches
  1. 9 core/modules/system/tests/src/Functional/System/ErrorHandlerTest.php \Drupal\Tests\system\Functional\System\ErrorHandlerTest::assertNoMessages()
  2. 10 core/modules/system/tests/src/Functional/System/ErrorHandlerTest.php \Drupal\Tests\system\Functional\System\ErrorHandlerTest::assertNoMessages()
  3. 11.x core/modules/system/tests/src/Functional/System/ErrorHandlerTest.php \Drupal\Tests\system\Functional\System\ErrorHandlerTest::assertNoMessages()

Asserts that no messages are printed onto the page.

Return value

bool TRUE, if there are no messages.

1 call to ErrorHandlerTest::assertNoMessages()
ErrorHandlerTest::testErrorHandler in core/modules/system/tests/src/Functional/System/ErrorHandlerTest.php
Test the error handler.

File

core/modules/system/tests/src/Functional/System/ErrorHandlerTest.php, line 174

Class

ErrorHandlerTest
Performs tests on the Drupal error and exception handler.

Namespace

Drupal\Tests\system\Functional\System

Code

protected function assertNoMessages() {
    return $this->assertEmpty($this->xpath('//div[contains(@class, "messages")]'), 'Ensures that also no messages div exists, which proves that no messages were generated by the error handler, not even an empty one.');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.