UpdatePathWithBrokenRoutingTest.php in Zircon Profile 8
File
core/modules/system/src/Tests/Update/UpdatePathWithBrokenRoutingTest.php
View source
<?php
namespace Drupal\system\Tests\Update;
class UpdatePathWithBrokenRoutingTest extends UpdatePathTestBase {
protected function setDatabaseDumpFiles() {
$this->databaseDumpFiles = [
__DIR__ . '/../../../tests/fixtures/update/drupal-8.bare.standard.php.gz',
__DIR__ . '/../../../tests/fixtures/update/drupal-8.broken_routing.php',
];
}
public function testWithBrokenRouting() {
\Drupal::state()
->set('update_script_test_broken_inbound', TRUE);
\Drupal::service('cache_tags.invalidator')
->invalidateTags([
'route_match',
'rendered',
]);
$this
->drupalGet('<front>');
$this
->assertResponse(500);
unlink(\Drupal::root() . '/' . $this->siteDirectory . '/error.log');
foreach ($this->assertions as $key => $assertion) {
if (strpos($assertion['message'], 'core/modules/system/tests/modules/update_script_test/src/PathProcessor/BrokenInboundPathProcessor.php') !== FALSE) {
unset($this->assertions[$key]);
$this
->deleteAssert($assertion['message_id']);
}
}
$this
->runUpdates();
\Drupal::state()
->set('update_script_test_broken_inbound', FALSE);
$this
->drupalGet('<front>');
$this
->assertResponse(200);
}
}