You are here

protected function RequirementsPageTrait::continueOnExpectedWarnings in Drupal 8

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/RequirementsPageTrait.php \Drupal\Tests\RequirementsPageTrait::continueOnExpectedWarnings()

Continues installation when the expected warnings are found.

This function is no longer called by any core test, but it is retained for use by contrib/custom tests. It is not deprecated, because it remains the recommended function to call for its purpose.

Parameters

string[] $expected_warnings: A list of warning summaries to expect on the requirements screen (e.g. 'PHP', 'PHP OPcode caching', etc.). If only the expected warnings are found, the test will click the "continue anyway" link to go to the next screen of the installer. If an expected warning is not found, or if a warning not in the list is present, a fail is raised.

File

core/tests/Drupal/Tests/RequirementsPageTrait.php, line 38

Class

RequirementsPageTrait
Provides helper methods for the requirements page.

Namespace

Drupal\Tests

Code

protected function continueOnExpectedWarnings($expected_warnings = []) {
  $this
    ->assertNoText('Errors found');
  $this
    ->assertWarningSummaries($expected_warnings);
  $this
    ->clickLink('continue anyway');
  $this
    ->checkForMetaRefresh();
}