Issue #3293288 by Spokje, alexpott, longwave, quietone: Remove the /core/modules/simpletest folder

merge-requests/2501/head
catch 2022-07-09 18:05:05 +09:00
parent 8982ddf414
commit 0586c53169
4 changed files with 12 additions and 65 deletions

View File

@ -29,7 +29,7 @@ trait FileMigrationTestTrait {
if ($destination['plugin'] === 'entity:file') {
// Make sure we have a single trailing slash.
$source = $migration->getSourceConfiguration();
$source['site_path'] = 'core/modules/simpletest';
$source['site_path'] = 'core/tests/fixtures';
$source['constants']['source_base_path'] = $this->root . '/';
$migration->set('source', $source);
}

View File

@ -31,6 +31,13 @@ class MigrateFileTest extends MigrateDrupal6TestBase implements MigrateDumpAlter
protected function setUp(): void {
parent::setUp();
// Remove the file_directory_path to test site_path setting.
// @see \Drupal\Tests\file\Kernel\Migrate\d6\FileMigrationTestTrait::prepareMigration()
Database::getConnection('default', 'migrate')
->delete('variable')
->condition('name', 'file_directory_path')
->execute();
$this->setUpMigratedFiles();
}
@ -97,11 +104,11 @@ class MigrateFileTest extends MigrateDrupal6TestBase implements MigrateDumpAlter
->truncate($map_table)
->execute();
// Update the file_directory_path.
// Set the file_directory_path.
Database::getConnection('default', 'migrate')
->update('variable')
->fields(['value' => serialize('files/test')])
->condition('name', 'file_directory_path')
->insert('variable')
->fields(['name', 'value'])
->values(['name' => 'file_directory_path', 'value' => serialize('files/test')])
->execute();
$this->executeMigration('d6_file');

View File

@ -1,8 +0,0 @@
name: Testing
type: module
description: 'Obsolete. SimpleTest has been removed from core.'
lifecycle: obsolete
lifecycle_link: 'https://www.drupal.org/about/core/policies/core-change-policies/deprecated-and-obsolete-modules-and-themes#s-simpletest'
package: Core
version: VERSION
hidden: true

View File

@ -1,52 +0,0 @@
<?php
/**
* @file
* Uninstall functions for the simpletest module.
*/
use Drupal\Core\Database\Database;
use Drupal\Core\File\Exception\FileException;
use Drupal\Core\Test\EnvironmentCleaner;
use Drupal\Core\Test\TestDatabase;
use Symfony\Component\Console\Output\NullOutput;
/**
* Implements hook_schema().
*/
function simpletest_schema() {
return TestDatabase::testingSchema();
}
/**
* Implements hook_uninstall().
*/
function simpletest_uninstall() {
// Do not clean the environment in case the Simpletest module is uninstalled
// in a (recursive) test for itself, since EnvironmentCleaner would also
// delete the test site of the parent test process.
if (!drupal_valid_test_ua()) {
// Clean up left-over tables and directories.
$cleaner = new EnvironmentCleaner(
DRUPAL_ROOT,
Database::getConnection(),
TestDatabase::getConnection(),
new NullOutput(),
\Drupal::service('file_system')
);
try {
$cleaner->cleanEnvironment();
}
catch (Exception $e) {
// Ignore.
}
}
// Delete verbose test output and any other testing framework files.
try {
\Drupal::service('file_system')->deleteRecursive('public://simpletest');
}
catch (FileException $e) {
// Ignore.
}
}