From ce1885d16c4a0420d8defcd39a516441ceb5ec59 Mon Sep 17 00:00:00 2001 From: catch <catch@35733.no-reply.drupal.org> Date: Tue, 10 Mar 2020 22:26:23 +0000 Subject: [PATCH] Issue #3119027 by Berdir, andypost: Use filled dump for RestSettingsDeletionUpdateTest --- .../fixtures/update/rest-module-installed.php | 59 ------------------- .../Update/RestSettingsDeletionUpdateTest.php | 6 +- 2 files changed, 1 insertion(+), 64 deletions(-) delete mode 100644 core/modules/rest/tests/fixtures/update/rest-module-installed.php diff --git a/core/modules/rest/tests/fixtures/update/rest-module-installed.php b/core/modules/rest/tests/fixtures/update/rest-module-installed.php deleted file mode 100644 index ae54885d0ae2..000000000000 --- a/core/modules/rest/tests/fixtures/update/rest-module-installed.php +++ /dev/null @@ -1,59 +0,0 @@ -<?php - -/** - * @file - * Test fixture for \Drupal\Tests\rest\Functional\Update\RestExportAuthCorrectionUpdateTest. - */ - -use Drupal\Core\Database\Database; - -$connection = Database::getConnection(); - -// Set the schema version. -$connection->insert('key_value') - ->fields([ - 'collection' => 'system.schema', - 'name' => 'rest', - 'value' => 'i:8401;', - ]) - ->execute(); -$connection->insert('key_value') - ->fields([ - 'collection' => 'system.schema', - 'name' => 'serialization', - 'value' => 'i:8401;', - ]) - ->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(); - -// Create rest.settings. -$connection->insert('config') - ->fields([ - 'collection', - 'name', - 'data', - ]) - ->values([ - 'collection' => '', - 'name' => 'rest.settings', - 'data' => 'a:1:{s:30:"bc_entity_resource_permissions";b:0;}', - ]) - ->execute(); diff --git a/core/modules/rest/tests/src/Functional/Update/RestSettingsDeletionUpdateTest.php b/core/modules/rest/tests/src/Functional/Update/RestSettingsDeletionUpdateTest.php index 9c6d7e2550ed..dbf078dbc98a 100644 --- a/core/modules/rest/tests/src/Functional/Update/RestSettingsDeletionUpdateTest.php +++ b/core/modules/rest/tests/src/Functional/Update/RestSettingsDeletionUpdateTest.php @@ -16,8 +16,7 @@ class RestSettingsDeletionUpdateTest extends UpdatePathTestBase { */ protected function setDatabaseDumpFiles() { $this->databaseDumpFiles = [ - __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.8.0.bare.standard.php.gz', - __DIR__ . '/../../../fixtures/update/rest-module-installed.php', + __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.8.0.filled.standard.php.gz', ]; } @@ -25,9 +24,6 @@ protected function setDatabaseDumpFiles() { * Ensures that update hook is run for "rest" module. */ public function testUpdate() { - // @todo Remove this in https://www.drupal.org/project/drupal/issues/3095333. - \Drupal::entityDefinitionUpdateManager()->installEntityType(\Drupal::entityTypeManager()->getDefinition('rest_resource_config')); - $rest_settings = $this->config('rest.settings'); $this->assertFalse($rest_settings->isNew()); -- GitLab