Skip to content

Commit

Permalink
Merge pull request #96 from humanmade/backport-95-to-v3-branch
Browse files Browse the repository at this point in the history
[Backport v3-branch] Ensure constants are defined during install
  • Loading branch information
roborourke authored Oct 6, 2020
2 parents 86e7104 + 22c566e commit dfe4fb9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 0 additions & 6 deletions inc/phpunit/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
/**
* Setup ElasticPress on install.
*/
define( 'EP_INDEX_PREFIX', 'tests_' );
tests_add_filter( 'plugins_loaded', function () {
global $table_prefix;

Expand Down Expand Up @@ -83,11 +82,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';
Expand Down
6 changes: 6 additions & 0 deletions inc/phpunit/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@
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_' );

// Set tests table prefix.
$table_prefix = 'wptests_';

Expand Down

0 comments on commit dfe4fb9

Please sign in to comment.