Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / web / core / lib / Drupal / Core / Test / FunctionalTestSetupTrait.php
index f9f97ecaa8c3e9543afc5f2cf0468ba217028bc9..3165815b175575060528ab9a94a4e6f222743c6c 100644 (file)
@@ -41,6 +41,18 @@ trait FunctionalTestSetupTrait {
    */
   protected $configDirectories = [];
 
+  /**
+   * The flag to set 'apcu_ensure_unique_prefix' setting.
+   *
+   * Wide use of a unique prefix can lead to problems with memory, if tests are
+   * run with a concurrency higher than 1. Therefore, FALSE by default.
+   *
+   * @var bool
+   *
+   * @see \Drupal\Core\Site\Settings::getApcuPrefix().
+   */
+  protected $apcuEnsureUniquePrefix = FALSE;
+
   /**
    * Prepares site settings and services before installation.
    */
@@ -83,6 +95,10 @@ trait FunctionalTestSetupTrait {
       'value' => $this->originalProfile,
       'required' => TRUE,
     ];
+    $settings['settings']['apcu_ensure_unique_prefix'] = (object) [
+      'value' => $this->apcuEnsureUniquePrefix,
+      'required' => TRUE,
+    ];
     $this->writeSettings($settings);
     // Allow for test-specific overrides.
     $settings_testing_file = DRUPAL_ROOT . '/' . $this->originalSite . '/settings.testing.php';