diff --git a/core/modules/system/tests/fixtures/update/drupal-8.no-preexisting-schema.php b/core/modules/system/tests/fixtures/update/drupal-8.no-preexisting-schema.php deleted file mode 100644 index 442fe56f26..0000000000 --- a/core/modules/system/tests/fixtures/update/drupal-8.no-preexisting-schema.php +++ /dev/null @@ -1,22 +0,0 @@ -select('config') - ->fields('config', ['data']) - ->condition('name', 'core.extension') - ->execute() - ->fetchField(); - -$extensions = unserialize($extensions); - $connection->update('config') - ->fields([ - 'data' => serialize(array_merge_recursive($extensions, ['module' => ['update_test_no_preexisting' => 0]])), - ]) - ->condition('name', 'core.extension') - ->execute(); diff --git a/core/modules/system/tests/src/Functional/Update/NoPreExistingSchemaUpdateTest.php b/core/modules/system/tests/src/Functional/UpdateSystem/NoPreExistingSchemaUpdateTest.php similarity index 43% rename from core/modules/system/tests/src/Functional/Update/NoPreExistingSchemaUpdateTest.php rename to core/modules/system/tests/src/Functional/UpdateSystem/NoPreExistingSchemaUpdateTest.php index 239b08df22..2d1b573fec 100644 --- a/core/modules/system/tests/src/Functional/Update/NoPreExistingSchemaUpdateTest.php +++ b/core/modules/system/tests/src/Functional/UpdateSystem/NoPreExistingSchemaUpdateTest.php @@ -1,8 +1,10 @@ databaseDumpFiles = [ - __DIR__ . '/../../../../tests/fixtures/update/drupal-8.8.0.bare.standard.php.gz', - __DIR__ . '/../../../../tests/fixtures/update/drupal-8.no-preexisting-schema.php', - ]; +class NoPreExistingSchemaUpdateTest extends BrowserTestBase { + use UpdatePathTestTrait; + + protected function setUp(){ + parent::setUp(); + $this->ensureUpdatesToRun(); + $connection = Database::getConnection(); + + // Enable the update_test_no_preexisting module. + $extensions = $connection->select('config') + ->fields('config', ['data']) + ->condition('name', 'core.extension') + ->execute() + ->fetchField(); + $extensions = unserialize($extensions); + $connection->update('config') + ->fields([ + 'data' => serialize(array_merge_recursive($extensions, ['module' => ['update_test_no_preexisting' => 0]])), + ]) + ->condition('name', 'core.extension') + ->execute(); } /** @@ -33,6 +46,7 @@ public function testNoPreExistingSchema() { $this->runUpdates(); $schema = \Drupal::keyValue('system.schema')->getAll(); + $this->assertArrayHasKey('update_test_no_preexisting', $schema); $this->assertEquals('8001', $schema['update_test_no_preexisting']); $this->assertTrue(\Drupal::state()->get('update_test_no_preexisting_update_8001', FALSE)); }