drupal-8.rest-rest_post_update_resource_granularity.php in Drupal 8
Contains database additions to drupal-8.bare.standard.php.gz for testing the upgrade path of rest_post_update_resource_granularity().
File
core/modules/rest/tests/fixtures/update/drupal-8.rest-rest_post_update_resource_granularity.phpView source
<?php
/**
* @file
* Contains database additions to drupal-8.bare.standard.php.gz for testing the
* upgrade path of rest_post_update_resource_granularity().
*/
use Drupal\Core\Database\Database;
use Drupal\Core\Serialization\Yaml;
$connection = Database::getConnection();
// Set the schema version.
$connection
->insert('key_value')
->fields([
'collection' => 'system.schema',
'name' => 'rest',
'value' => 'i:8201;',
])
->execute();
// Update core.extension.
$extensions = $connection
->select('config')
->fields('config', [
'data',
])
->condition('collection', '')
->condition('name', 'core.extension')
->execute()
->fetchField();
$extensions = unserialize($extensions);
$extensions['module']['rest'] = 0;
$extensions['module']['serialization'] = 0;
$connection
->update('config')
->fields([
'data' => serialize($extensions),
])
->condition('collection', '')
->condition('name', 'core.extension')
->execute();
$connection
->merge('key_value')
->condition('collection', 'entity.definitions.installed')
->condition('name', 'rest_resource_config.entity_type')
->fields([
'value' => 'O:42:"Drupal\\Core\\Config\\Entity\\ConfigEntityType":39:{s:16:"