You are here

protected function TestBase::assertNoErrorsLogged in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/simpletest/src/TestBase.php \Drupal\simpletest\TestBase::assertNoErrorsLogged()

Asserts that no errors have been logged to the PHP error.log thus far.

Return value

bool TRUE if the assertion succeeded, FALSE otherwise.

See also

\Drupal\simpletest\TestBase::prepareEnvironment()

\Drupal\Core\DrupalKernel::bootConfiguration()

3 calls to TestBase::assertNoErrorsLogged()
ErrorHandlerTest::testExceptionHandler in core/modules/system/src/Tests/System/ErrorHandlerTest.php
Test the exception handler.
FormValuesTest::testSimpleAjaxFormValue in core/modules/system/src/Tests/Ajax/FormValuesTest.php
Submits forms with select and checkbox elements via Ajax.
UncaughtExceptionTest::testLoggerException in core/modules/system/src/Tests/System/UncaughtExceptionTest.php
Tests fallback to PHP error log when an exception is thrown while logging.

File

core/modules/simpletest/src/TestBase.php, line 827
Contains \Drupal\simpletest\TestBase.

Class

TestBase
Base class for Drupal tests.

Namespace

Drupal\simpletest

Code

protected function assertNoErrorsLogged() {

  // Since PHP only creates the error.log file when an actual error is
  // triggered, it is sufficient to check whether the file exists.
  return $this
    ->assertFalse(file_exists(DRUPAL_ROOT . '/' . $this->siteDirectory . '/error.log'), 'PHP error.log is empty.');
}