Commit 952cb0b1 authored by catch's avatar catch
Browse files

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

(cherry picked from commit 0586c531)
parent b9adafa4
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -29,7 +29,7 @@ protected function prepareMigration(MigrationInterface $migration) {
    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);
    }
+11 −4
Original line number Diff line number Diff line
@@ -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 @@ public function testFiles() {
      ->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');
+0 −8
Original line number Diff line number Diff line
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
+0 −52
Original line number Diff line number Diff line
<?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.
  }
}