class UpdatePathWithBrokenRoutingTest
Same name and namespace in other branches
- 11.x core/modules/system/tests/src/Functional/UpdateSystem/UpdatePathWithBrokenRoutingTest.php \Drupal\Tests\system\Functional\UpdateSystem\UpdatePathWithBrokenRoutingTest
- 10 core/modules/system/tests/src/Functional/UpdateSystem/UpdatePathWithBrokenRoutingTest.php \Drupal\Tests\system\Functional\UpdateSystem\UpdatePathWithBrokenRoutingTest
- 8.9.x core/modules/system/tests/src/Functional/UpdateSystem/UpdatePathWithBrokenRoutingTest.php \Drupal\Tests\system\Functional\UpdateSystem\UpdatePathWithBrokenRoutingTest
Tests the update path with a broken router.
@group Update
Hierarchy
- class \Drupal\Tests\BrowserTestBase uses \Drupal\Core\Test\FunctionalTestSetupTrait, \Drupal\Tests\UiHelperTrait, \Drupal\Core\Test\TestSetupTrait, \Drupal\Tests\block\Traits\BlockCreationTrait, \Drupal\FunctionalTests\AssertLegacyTrait, \Drupal\Tests\RandomGeneratorTrait, \Drupal\Tests\node\Traits\NodeCreationTrait, \Drupal\Tests\node\Traits\ContentTypeCreationTrait, \Drupal\Tests\ConfigTestTrait, \Drupal\Tests\TestRequirementsTrait, \Drupal\Tests\user\Traits\UserCreationTrait, \Drupal\Tests\XdebugRequestTrait, \Drupal\Tests\Traits\PhpUnitWarnings, \Drupal\Tests\PhpUnitCompatibilityTrait, \Symfony\Bridge\PhpUnit\ExpectDeprecationTrait, \Drupal\Tests\ExtensionListTestTrait extends \PHPUnit\Framework\TestCase
- class \Drupal\Tests\system\Functional\UpdateSystem\UpdatePathWithBrokenRoutingTest uses \Drupal\Tests\UpdatePathTestTrait extends \Drupal\Tests\BrowserTestBase
Expanded class hierarchy of UpdatePathWithBrokenRoutingTest
File
-
core/
modules/ system/ tests/ src/ Functional/ UpdateSystem/ UpdatePathWithBrokenRoutingTest.php, line 14
Namespace
Drupal\Tests\system\Functional\UpdateSystemView source
class UpdatePathWithBrokenRoutingTest extends BrowserTestBase {
use UpdatePathTestTrait;
/**
* {@inheritdoc}
*/
protected $defaultTheme = 'stark';
/**
* {@inheritdoc}
*/
protected function setUp() : void {
parent::setUp();
$this->ensureUpdatesToRun();
}
/**
* Tests running update.php with some form of broken routing.
*/
public function testWithBrokenRouting() {
// 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.