UpdatePathWithBrokenRoutingTest.php in Drupal 8
File
core/modules/system/tests/src/Functional/UpdateSystem/UpdatePathWithBrokenRoutingTest.php
View source
<?php
namespace Drupal\Tests\system\Functional\UpdateSystem;
use Drupal\Core\Url;
use Drupal\Tests\BrowserTestBase;
use Drupal\Tests\UpdatePathTestTrait;
class UpdatePathWithBrokenRoutingTest extends BrowserTestBase {
use UpdatePathTestTrait;
protected $defaultTheme = 'stark';
protected function setUp() {
parent::setUp();
$this
->ensureUpdatesToRun();
}
public function testWithBrokenRouting() {
\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,
]));
\Drupal::state()
->set('update_script_test_broken_inbound', FALSE);
$this
->drupalGet('<front>');
$this
->assertSession()
->statusCodeEquals(200);
}
}