Skip to content
Snippets Groups Projects
Commit 3444108a authored by Alex Pott's avatar Alex Pott
Browse files

Issue #2565259 by plach, Antti J. Salminen, stefan.r, dawehner: Some route...

Issue #2565259 by plach, Antti J. Salminen, stefan.r, dawehner: Some route serializations in update test database dumps are broken
parent c0f0df5c
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -98,7 +98,7 @@ protected function execute(InputInterface $input, OutputInterface $output) {
$output->setDecorated(FALSE);
}
$output->writeln($this->generateScript());
$output->writeln($this->generateScript(), OutputInterface::OUTPUT_RAW);
}
/**
......
......@@ -7,6 +7,7 @@
namespace Drupal\system\Tests\Update;
use Drupal\Component\Utility\Html;
use Drupal\Component\Utility\SafeMarkup;
/**
......@@ -38,6 +39,26 @@ public function testDatabaseLoaded() {
foreach (['user', 'node', 'system', 'update_test_schema'] as $module) {
$this->assertEqual(drupal_get_installed_schema_version($module), 8000, SafeMarkup::format('Module @module schema is 8000', ['@module' => $module]));
}
// Ensure that all {router} entries can be unserialized. If they cannot be
// unserialized a notice will be thrown by PHP.
$result = \Drupal::database()->query("SELECT name, route from {router}")->fetchAllKeyed(0, 1);
// For the purpose of fetching the notices and displaying more helpful error
// messages, let's override the error handler temporarily.
set_error_handler(function ($severity, $message, $filename, $lineno) {
throw new \ErrorException($message, 0, $severity, $filename, $lineno);
});
foreach ($result as $route_name => $route) {
try {
unserialize($route);
}
catch (\Exception $e) {
$this->fail(sprintf('Error "%s" while unserializing route %s', $e->getMessage(), Html::escape($route_name)));
}
}
restore_error_handler();
// Before accessing the site we need to run updates first or the site might
// be broken.
$this->runUpdates();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment