message-digest-update-8101.php in Message Digest 8
Upgrade data for message_digest_update_8101().
Contains database additions to drupal-8.bare.standard.php.gz for testing the upgrade path of message_digest_update_8101().
File
tests/fixtures/update/message-digest-update-8101.phpView source
<?php
/**
* @file
* Upgrade data for message_digest_update_8101().
*
* Contains database additions to drupal-8.bare.standard.php.gz for testing the
* upgrade path of message_digest_update_8101().
*/
use Drupal\Core\Database\Database;
$connection = Database::getConnection();
// Set the schema version.
$connection
->insert('key_value')
->fields([
'collection' => 'system.schema',
'name' => 'message_digest',
'value' => 'i:8100;',
])
->execute();
// Update core.extension to enable message_digest.
$extensions = $connection
->select('config')
->fields('config', [
'data',
])
->condition('collection', '')
->condition('name', 'core.extension')
->execute()
->fetchField();
$extensions = unserialize($extensions);
$extensions['module']['message'] = 0;
$extensions['module']['message_digest'] = 0;
$extensions['module']['message_notify'] = 0;
$connection
->update('config')
->fields([
'data' => serialize($extensions),
])
->condition('collection', '')
->condition('name', 'core.extension')
->execute();
// Install the message template entity type.
$connection
->merge('key_value')
->condition('collection', 'entity.definitions.installed')
->condition('name', 'message_template.entity_type')
->fields([
'value' => 'O:42:"Drupal\\Core\\Config\\Entity\\ConfigEntityType":41:{s:16:"