Commit 44949a18 authored by webchick's avatar webchick

Issue #2555183 by jhedstrom, Gábor Hojtsy, mikeryan, stefan.r, xjm: Fix the...

Issue #2555183 by jhedstrom, Gábor Hojtsy, mikeryan, stefan.r, xjm: Fix the filled update tests, they are broken
parent 6c04c93e
......@@ -17,9 +17,9 @@ class BlockContextMappingUpdateFilledTest extends BlockContextMappingUpdateTest
/**
* {@inheritdoc}
*/
protected function setUp() {
protected function setDatabaseDumpFiles() {
parent::setDatabaseDumpFiles();
$this->databaseDumpFiles[0] = __DIR__ . '/../../../../system/tests/fixtures/update/drupal-8.filled.standard.php.gz';
parent::setUp();
}
}
......@@ -28,12 +28,11 @@ class BlockContextMappingUpdateTest extends UpdatePathTestBase {
/**
* {@inheritdoc}
*/
protected function setUp() {
protected function setDatabaseDumpFiles() {
$this->databaseDumpFiles = [
__DIR__ . '/../../../../system/tests/fixtures/update/drupal-8.bare.standard.php.gz',
__DIR__ . '/../../../../system/tests/fixtures/update/drupal-8.block-context-manager-2354889.php',
];
parent::setUp();
}
/**
......
......@@ -17,9 +17,9 @@ class SqlContentEntityStorageSchemaIndexFilledTest extends SqlContentEntityStora
/**
* {@inheritdoc}
*/
public function setUp() {
protected function setDatabaseDumpFiles() {
parent::setDatabaseDumpFiles();
$this->databaseDumpFiles[0] = __DIR__ . '/../../../../tests/fixtures/update/drupal-8.filled.standard.php.gz';
parent::setUp();
}
}
......@@ -19,11 +19,10 @@ class SqlContentEntityStorageSchemaIndexTest extends UpdatePathTestBase {
/**
* {@inheritdoc}
*/
public function setUp() {
protected function setDatabaseDumpFiles() {
$this->databaseDumpFiles = [
__DIR__ . '/../../../../tests/fixtures/update/drupal-8.bare.standard.php.gz',
];
parent::setUp();
}
/**
......
......@@ -17,9 +17,9 @@ class MenuTreeSerializationTitleFilledTest extends MenuTreeSerializationTitleTes
/**
* {@inheritdoc}
*/
public function setUp() {
protected function setDatabaseDumpFiles() {
parent::setDatabaseDumpFiles();
$this->databaseDumpFiles[0] = __DIR__ . '/../../../tests/fixtures/update/drupal-8.filled.standard.php.gz';
parent::setUp();
}
}
......@@ -19,11 +19,10 @@ class MenuTreeSerializationTitleTest extends UpdatePathTestBase {
/**
* {@inheritdoc}
*/
public function setUp() {
protected function setDatabaseDumpFiles() {
$this->databaseDumpFiles = [
__DIR__ . '/../../../tests/fixtures/update/drupal-8.bare.standard.php.gz',
];
parent::setUp();
}
/**
......
......@@ -16,9 +16,9 @@ class RouterIndexOptimizationFilledTest extends RouterIndexOptimizationTest {
/**
* {@inheritdoc}
*/
public function setUp() {
protected function setDatabaseDumpFiles() {
parent::setDatabaseDumpFiles();
$this->databaseDumpFiles[0] = __DIR__ . '/../../../tests/fixtures/update/drupal-8.filled.standard.php.gz';
parent::setUp();
}
}
......@@ -15,11 +15,10 @@ class RouterIndexOptimizationTest extends UpdatePathTestBase {
/**
* {@inheritdoc}
*/
public function setUp() {
protected function setDatabaseDumpFiles() {
$this->databaseDumpFiles = [
__DIR__ . '/../../../tests/fixtures/update/drupal-8.bare.standard.php.gz',
];
parent::setUp();
}
/**
......
......@@ -130,9 +130,6 @@ abstract class UpdatePathTestBase extends WebTestBase {
function __construct($test_id = NULL) {
parent::__construct($test_id);
$this->zlibInstalled = function_exists('gzopen');
// Set the update url.
$this->updateUrl = Url::fromRoute('system.db_update');
}
/**
......@@ -144,6 +141,10 @@ function __construct($test_id = NULL) {
* container that would normally be done via the installer.
*/
protected function setUp() {
// Allow classes to set database dump files.
$this->setDatabaseDumpFiles();
// We are going to set a missing zlib requirement property for usage
// during the performUpgrade() and tearDown() methods. Also set that the
// tests failed.
......@@ -152,6 +153,11 @@ protected function setUp() {
return;
}
// Set the update url. This must be set here rather than in
// self::__construct() or the old URL generator will leak additional test
// sites.
$this->updateUrl = Url::fromRoute('system.db_update');
// These methods are called from parent::setUp().
$this->setBatch();
$this->initUserSession();
......@@ -191,6 +197,11 @@ protected function setUp() {
$account->save();
}
/**
* Set database dump files to be used.
*/
abstract protected function setDatabaseDumpFiles();
/**
* Add settings that are missed since the installer isn't run.
*/
......@@ -238,6 +249,9 @@ protected function runUpdates() {
// Run the update hooks.
$this->clickLink(t('Apply pending updates'));
// Ensure there are no failed updates.
$this->assertNoRaw('<strong>' . t('Failed:') . '</strong>');
// The config schema can be incorrect while the update functions are being
// executed. But once the update has been completed, it needs to be valid
// again. Assert the schema of all configuration objects now.
......
......@@ -17,9 +17,8 @@ class UpdatePathTestBaseFilledTest extends UpdatePathTestBaseTest {
/**
* {@inheritdoc}
*/
protected function setUp() {
protected function setDatabaseDumpFiles() {
$this->databaseDumpFiles[0] = __DIR__ . '/../../../tests/fixtures/update/drupal-8.filled.standard.php.gz';
parent::setUp();
}
}
......@@ -24,9 +24,8 @@ class UpdatePathTestBaseTest extends UpdatePathTestBase {
/**
* {@inheritdoc}
*/
protected function setUp() {
protected function setDatabaseDumpFiles() {
$this->databaseDumpFiles = [__DIR__ . '/../../../tests/fixtures/update/drupal-8.bare.standard.php.gz'];
parent::setUp();
}
/**
......
......@@ -17,9 +17,9 @@ class UpdatePathWithBrokenRoutingFilledTest extends UpdatePathWithBrokenRoutingT
/**
* {@inheritdoc}
*/
protected function setUp() {
$this->databaseDumpFiles[0] = '/../../../tests/fixtures/update/drupal-8.filled.standard.php.gz';
parent::setUp();
protected function setDatabaseDumpFiles() {
parent::setDatabaseDumpFiles();
$this->databaseDumpFiles[0] = __DIR__ . '/../../../tests/fixtures/update/drupal-8.filled.standard.php.gz';
}
}
......@@ -17,22 +17,17 @@ class UpdatePathWithBrokenRoutingTest extends UpdatePathTestBase {
/**
* {@inheritdoc}
*/
protected function setUp() {
protected function setDatabaseDumpFiles() {
$this->databaseDumpFiles = [
__DIR__ . '/../../../tests/fixtures/update/drupal-8.bare.standard.php.gz',
__DIR__ . '/../../../tests/fixtures/update/drupal-8.broken_routing.php',
];
parent::setUp();
}
/**
* Tests running update.php with some form of broken routing.
*/
public function testWithBrokenRouting() {
// Make sure we can get to the front page.
$this->drupalGet('<front>');
$this->assertResponse(200);
// Simulate a broken router, and make sure the front page is
// inaccessible.
\Drupal::state()->set('update_script_test_broken_inbound', TRUE);
......
......@@ -17,9 +17,9 @@ class EntityViewsDataUpdateFilledTest extends EntityViewsDataUpdateTest {
/**
* {@inheritdoc}
*/
protected function setUp() {
protected function setDatabaseDumpFiles() {
parent::setDatabaseDumpFiles();
$this->databaseDumpFiles[0] = __DIR__ . '/../../../../system/tests/fixtures/update/drupal-8.filled.standard.php.gz';
parent::setUp();
}
}
......@@ -22,13 +22,11 @@ class EntityViewsDataUpdateTest extends UpdatePathTestBase {
/**
* {@inheritdoc}
*/
protected function setUp() {
protected function setDatabaseDumpFiles() {
$this->databaseDumpFiles = [
__DIR__ . '/../../../../system/tests/fixtures/update/drupal-8.bare.standard.php.gz',
__DIR__ . '/../../../../system/tests/fixtures/update/drupal-8.views-entity-views-data-2455125.php',
];
parent::setUp();
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment