function UpdateMiscTest::testServiceUnavailable

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

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

File

core/modules/update/tests/src/Functional/UpdateMiscTest.php, line 88

Class

UpdateMiscTest
Tests general functionality of the Update module.

Namespace

Drupal\Tests\update\Functional

Code

public function testServiceUnavailable() : void {
    $admin_user = $this->drupalCreateUser([
        'administer site configuration',
    ]);
    $this->drupalLogin($admin_user);
    $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.');
}

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