Commit b0cb325a authored by catch's avatar catch
Browse files

Issue #3293216 by longwave, Spokje, quietone: Rename references to Simpletest in tests

(cherry picked from commit ebe774d4)
parent 90046b01
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -25,7 +25,7 @@ sites/*/services*.yml
sites/*/files
sites/*/private

# Ignore SimpleTest multi-site environment.
# Ignore multi-site test environment.
sites/simpletest

# If you prefer to store your .gitignore file in the sites/ folder, comment
@@ -38,5 +38,5 @@ sites/simpletest
# */files
# */private

# Ignore SimpleTest multi-site environment.
# Ignore multi-site test environment.
# simpletest
+4 −5
Original line number Diff line number Diff line
@@ -201,7 +201,7 @@ function _drupal_exception_handler_additional($exception, $exception2) {
}

/**
 * Returns the test prefix if this is an internal request from SimpleTest.
 * Returns the test prefix if this is an internal request from a test.
 *
 * @param string $new_prefix
 *   Internal use only. A new prefix to be stored.
@@ -224,9 +224,8 @@ function drupal_valid_test_ua($new_prefix = NULL) {
  // a test environment.
  $test_prefix = FALSE;

  // A valid Simpletest request will contain a hashed and salted authentication
  // code. Check if this code is present in a cookie or custom user agent
  // string.
  // A valid test request will contain a hashed and salted authentication code.
  // Check if this code is present in a cookie or custom user agent string.
  $http_user_agent = $_SERVER['HTTP_USER_AGENT'] ?? NULL;
  $user_agent = $_COOKIE['SIMPLETEST_USER_AGENT'] ?? $http_user_agent;
  if (isset($user_agent) && preg_match("/^simple(\w+\d+):(.+):(.+):(.+)$/", $user_agent, $matches)) {
@@ -268,7 +267,7 @@ function drupal_valid_test_ua($new_prefix = NULL) {
}

/**
 * Generates a user agent string with a HMAC and timestamp for simpletest.
 * Generates a user agent string with a HMAC and timestamp for tests.
 */
function drupal_generate_test_ua($prefix) {
  static $key, $last_prefix;
+1 −1
Original line number Diff line number Diff line
@@ -29,7 +29,7 @@ class DbDumpCommand extends DbCommandBase {
  /**
   * An array of table patterns to exclude completely.
   *
   * This excludes any lingering simpletest tables generated during test runs.
   * This excludes any lingering tables generated during test runs.
   *
   * @var array
   */
+2 −2
Original line number Diff line number Diff line
@@ -370,7 +370,7 @@ public static function findSitePath(Request $request, $require_settings = TRUE,
      $app_root = static::guessApplicationRoot();
    }

    // Check for a simpletest override.
    // Check for a test override.
    if ($test_prefix = drupal_valid_test_ua()) {
      $test_db = new TestDatabase($test_prefix);
      return $test_db->getTestSitePath();
@@ -982,7 +982,7 @@ public static function bootEnvironment($app_root = NULL) {
        // Only code that interfaces directly with tests should rely on this
        // constant; e.g., the error/exception handler conditionally adds further
        // error information into HTTP response headers that are consumed by
        // Simpletest's internal browser.
        // the internal browser.
        define('DRUPAL_TEST_IN_CHILD_SITE', TRUE);

        // Web tests are to be conducted with runtime assertions active.
+2 −2
Original line number Diff line number Diff line
@@ -168,8 +168,8 @@ public function scan($type, $include_tests = NULL) {
    // expected extension type specific directory names only.
    $searchdirs[static::ORIGIN_ROOT] = '';

    // Simpletest uses the regular built-in multi-site functionality of Drupal
    // for running web tests. As a consequence, extensions of the parent site
    // Tests use the regular built-in multi-site functionality of Drupal for
    // running web tests. As a consequence, extensions of the parent site
    // located in a different site-specific directory are not discovered in a
    // test site environment, because the site directories are not the same.
    // Therefore, add the site directory of the parent site to the search paths,
Loading