X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Frest%2Ftests%2Ffixtures%2Fupdate%2Frest-export-with-authentication-correction.php;fp=web%2Fcore%2Fmodules%2Frest%2Ftests%2Ffixtures%2Fupdate%2Frest-export-with-authentication-correction.php;h=6cbd04e8b03ec0177c04436551803a295c08abb7;hb=9917807b03b64faf00f6a1f29dcb6eafc454efa5;hp=0000000000000000000000000000000000000000;hpb=aea91e65e895364e460983b890e295aa5d5540a5;p=yaffs-website diff --git a/web/core/modules/rest/tests/fixtures/update/rest-export-with-authentication-correction.php b/web/core/modules/rest/tests/fixtures/update/rest-export-with-authentication-correction.php new file mode 100644 index 000000000..6cbd04e8b --- /dev/null +++ b/web/core/modules/rest/tests/fixtures/update/rest-export-with-authentication-correction.php @@ -0,0 +1,63 @@ +insert('key_value') + ->fields([ + 'collection' => 'system.schema', + 'name' => 'rest', + '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']['rest'] = 0; +$extensions['module']['serialization'] = 0; +$extensions['module']['basic_auth'] = 0; +$connection->update('config') + ->fields([ + 'data' => serialize($extensions), + ]) + ->condition('collection', '') + ->condition('name', 'core.extension') + ->execute(); + +$connection->insert('config') + ->fields([ + 'name' => 'rest.settings', + 'data' => serialize([ + 'link_domain' => '~', + ]), + 'collection' => '', + ]) + ->execute(); + +$connection->insert('config') + ->fields([ + 'name' => 'views.view.rest_export_with_authorization_correction', + ]) + ->execute(); + +$connection->merge('config') + ->condition('name', 'views.view.rest_export_with_authorization_correction') + ->condition('collection', '') + ->fields([ + 'data' => serialize(Yaml::decode(file_get_contents('core/modules/views/tests/modules/views_test_config/test_views/views.view.rest_export_with_authorization_correction.yml'))), + ]) + ->execute();