From 343611bddaaabd56bc07e952be06bfa7857568f7 Mon Sep 17 00:00:00 2001 From: Robert O'Rourke Date: Mon, 5 Oct 2020 11:42:08 +0000 Subject: [PATCH] Move cache key salt to config file --- inc/phpunit/bootstrap.php | 5 ----- inc/phpunit/config.php | 3 +++ 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/inc/phpunit/bootstrap.php b/inc/phpunit/bootstrap.php index 244e4dd..f9115d0 100644 --- a/inc/phpunit/bootstrap.php +++ b/inc/phpunit/bootstrap.php @@ -84,11 +84,6 @@ } }, 21 ); -/** - * Modify the cache keys to prevent conflicts. - */ -define( 'WP_CACHE_KEY_SALT', 'phpunit' ); - // Load custom bootstrap code. if ( file_exists( Altis\PHPUNIT_PROJECT_ROOT . '/.config/tests-bootstrap.php' ) ) { require Altis\PHPUNIT_PROJECT_ROOT . '/.config/tests-bootstrap.php'; diff --git a/inc/phpunit/config.php b/inc/phpunit/config.php index 60e8bc6..ed30301 100644 --- a/inc/phpunit/config.php +++ b/inc/phpunit/config.php @@ -16,6 +16,9 @@ defined( 'WP_TESTS_EMAIL' ) or define( 'WP_TESTS_EMAIL', 'admin@example.org' ); defined( 'WP_TESTS_TITLE' ) or define( 'WP_TESTS_TITLE', 'Test Blog' ); +// Ensure cache key salt is different for test runs. +defined( 'WP_CACHE_KEY_SALT' ) or define( 'WP_CACHE_KEY_SALT', 'phpunit' ); + // Ensure tests use their own ElasticPress indexes. defined( 'EP_INDEX_PREFIX' ) or define( 'EP_INDEX_PREFIX', 'tests_' );