function UpdateScriptTest::assertUpdateWithNoErrors

Same name in other branches
  1. 11.x core/modules/system/tests/src/Functional/UpdateSystem/UpdateScriptTest.php \Drupal\Tests\system\Functional\UpdateSystem\UpdateScriptTest::assertUpdateWithNoErrors()

Asserts particular errors are not shown on update and status report pages.

@internal

Parameters

array $unexpected_error_texts: An array of the error texts that should not be shown.

string $extension_type: The extension type, either 'module' or 'theme'.

array $extension_machine_names: An array of the extension machine names.

Throws

\Behat\Mink\Exception\ResponseTextException

2 calls to UpdateScriptTest::assertUpdateWithNoErrors()
UpdateScriptTest::testExtensionCompatibilityChange in core/modules/system/tests/src/Functional/UpdateSystem/UpdateScriptTest.php
Tests that extension compatibility changes are handled correctly.
UpdateScriptTest::testMissingExtension in core/modules/system/tests/src/Functional/UpdateSystem/UpdateScriptTest.php
Tests that a missing extension prevents updates.

File

core/modules/system/tests/src/Functional/UpdateSystem/UpdateScriptTest.php, line 997

Class

UpdateScriptTest
Tests the update script access and functionality.

Namespace

Drupal\Tests\system\Functional\UpdateSystem

Code

protected function assertUpdateWithNoErrors(array $unexpected_error_texts, string $extension_type, array $extension_machine_names) : void {
    $assert_session = $this->assertSession();
    foreach ($unexpected_error_texts as $unexpected_error_text) {
        $this->assertSession()
            ->pageTextNotContains($unexpected_error_text);
    }
    $this->drupalGet($this->updateUrl, [
        'external' => TRUE,
    ]);
    foreach ($unexpected_error_texts as $unexpected_error_text) {
        $this->assertSession()
            ->pageTextNotContains($unexpected_error_text);
    }
    $this->updateRequirementsProblem();
    $this->clickLink('Continue');
    $assert_session->pageTextContains('No pending updates.');
    $this->assertInstalledExtensionsConfig($extension_type, $extension_machine_names);
}

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