You are here

public function UpdateSemverCoreTest::testServiceUnavailable in Drupal 9

Same name and namespace in other branches
  1. 10 core/modules/update/tests/src/Functional/UpdateSemverCoreTest.php \Drupal\Tests\update\Functional\UpdateSemverCoreTest::testServiceUnavailable()

Tests the Update Manager module when the update server returns 503 errors.

File

core/modules/update/tests/src/Functional/UpdateSemverCoreTest.php, line 405

Class

UpdateSemverCoreTest
Tests the Update Manager module through a series of functional tests using mock XML data.

Namespace

Drupal\Tests\update\Functional

Code

public function testServiceUnavailable() {
  $this
    ->refreshUpdateStatus([], '503-error');

  // Ensure that no "Warning: SimpleXMLElement..." parse errors are found.
  $this
    ->assertSession()
    ->pageTextNotContains('SimpleXMLElement');
  $this
    ->assertSession()
    ->pageTextContainsOnce('Failed to get available update data for one project.');
}