function UpdatePathWithBrokenRoutingTest::testWithBrokenRouting

Same name in other branches
  1. 9 core/modules/system/tests/src/Functional/UpdateSystem/UpdatePathWithBrokenRoutingTest.php \Drupal\Tests\system\Functional\UpdateSystem\UpdatePathWithBrokenRoutingTest::testWithBrokenRouting()
  2. 8.9.x core/modules/system/tests/src/Functional/UpdateSystem/UpdatePathWithBrokenRoutingTest.php \Drupal\Tests\system\Functional\UpdateSystem\UpdatePathWithBrokenRoutingTest::testWithBrokenRouting()
  3. 10 core/modules/system/tests/src/Functional/UpdateSystem/UpdatePathWithBrokenRoutingTest.php \Drupal\Tests\system\Functional\UpdateSystem\UpdatePathWithBrokenRoutingTest::testWithBrokenRouting()

Tests running update.php with some form of broken routing.

File

core/modules/system/tests/src/Functional/UpdateSystem/UpdatePathWithBrokenRoutingTest.php, line 35

Class

UpdatePathWithBrokenRoutingTest
Tests the update path with a broken router.

Namespace

Drupal\Tests\system\Functional\UpdateSystem

Code

public function testWithBrokenRouting() : void {
    // Simulate a broken router, and make sure the front page is
    // inaccessible.
    \Drupal::state()->set('update_script_test_broken_inbound', TRUE);
    $this->resetAll();
    $this->drupalGet('<front>');
    $this->assertSession()
        ->statusCodeEquals(500);
    $this->runUpdates(Url::fromRoute('system.db_update', [], [
        'path_processing' => FALSE,
    ]));
    // Remove the simulation of the broken router, and make sure we can get to
    // the front page again.
    \Drupal::state()->set('update_script_test_broken_inbound', FALSE);
    $this->drupalGet('<front>');
    $this->assertSession()
        ->statusCodeEquals(200);
}

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