diff --git a/core/modules/system/src/Tests/Update/UpdatePathTestBaseTest.php b/core/modules/system/src/Tests/Update/UpdatePathTestBaseTest.php index fb01ecf..fa2b96b 100644 --- a/core/modules/system/src/Tests/Update/UpdatePathTestBaseTest.php +++ b/core/modules/system/src/Tests/Update/UpdatePathTestBaseTest.php @@ -25,7 +25,10 @@ class UpdatePathTestBaseTest extends UpdatePathTestBase { * {@inheritdoc} */ protected function setUp() { - $this->databaseDumpFiles = [__DIR__ . '/../../../tests/fixtures/update/drupal-8.bare.standard.php.gz']; + $this->databaseDumpFiles = [ + __DIR__ . '/../../../tests/fixtures/update/drupal-8.bare.standard.php.gz', + __DIR__ . '/../../../tests/fixtures/update/drupal-8.update-test-schema-enabled.php', + ]; parent::setUp(); } diff --git a/core/modules/system/tests/fixtures/update/drupal-8.update-test-schema-enabled.php b/core/modules/system/tests/fixtures/update/drupal-8.update-test-schema-enabled.php new file mode 100644 index 0000000..16042a4 --- /dev/null +++ b/core/modules/system/tests/fixtures/update/drupal-8.update-test-schema-enabled.php @@ -0,0 +1,52 @@ +schema()->createTable('update_test_schema_table', array( + 'fields' => array( + 'a' => array( + 'type' => 'int', + 'not null' => TRUE, + 'size' => 'normal', + ), + 'b' => array( + 'type' => 'blob', + 'not null' => FALSE, + 'size' => 'normal', + ), + ), +)); + +// Set the schema version. +$connection->insert('key_value') + ->fields([ + 'collection' => 'system.schema', + 'name' => 'update_test_schema', + 'value' => 'i:8000;', + ]) + ->execute(); + +// Update core.extension. +$extensions = $connection->select('config') + ->fields('config', ['data']) + ->condition('collection', '') + ->condition('name', 'core.extension') + ->execute() + ->fetchField(); +$extensions = unserialize($extensions); +$extensions['module']['update_test_schema'] = 8000; +$connection->update('config') + ->fields([ + 'data' => serialize($extensions), + ]) + ->condition('collection', '') + ->condition('name', 'core.extension') + ->execute();