You are here

protected function TestBase::assertNoErrorsLogged in Drupal 8

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()

File

core/modules/simpletest/src/TestBase.php, line 734

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.');
}