Mercurial > hg > isophonics-drupal-site
diff core/modules/system/tests/fixtures/update/drupal-8.update-test-postupdate-enabled.php @ 0:4c8ae668cc8c
Initial import (non-working)
author | Chris Cannam |
---|---|
date | Wed, 29 Nov 2017 16:09:58 +0000 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/modules/system/tests/fixtures/update/drupal-8.update-test-postupdate-enabled.php Wed Nov 29 16:09:58 2017 +0000 @@ -0,0 +1,39 @@ +<?php + +/** + * @file + * Partial database to mimic the installation of the update_test_post_update + * module. + */ + +use Drupal\Core\Database\Database; + +$connection = Database::getConnection(); + +// Set the schema version. +$connection->merge('key_value') + ->condition('collection', 'system.schema') + ->condition('name', 'update_test_postupdate') + ->fields([ + 'collection' => 'system.schema', + 'name' => 'update_test_postupdate', + '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_postupdate'] = 8000; +$connection->update('config') + ->fields([ + 'data' => serialize($extensions), + ]) + ->condition('collection', '') + ->condition('name', 'core.extension') + ->execute();