diff --git a/module/VuFind/tests/bootstrap.php b/module/VuFind/tests/bootstrap.php index 7b32da1a8507841b71ec1f563d885572695d6d7c..6add9b6255fcae185cfd48573ebd557fd6125b60 100644 --- a/module/VuFind/tests/bootstrap.php +++ b/module/VuFind/tests/bootstrap.php @@ -7,15 +7,37 @@ define('VUFIND_PHPUNIT_RUNNING', 1); define('VUFIND_PHPUNIT_MODULE_PATH', __DIR__); // Define path to application directory -defined('APPLICATION_PATH') || define('APPLICATION_PATH', realpath(dirname(__DIR__) . '/../..')); +defined('APPLICATION_PATH') + || define( + 'APPLICATION_PATH', + (getenv('VUFIND_APPLICATION_PATH') ? getenv('VUFIND_APPLICATION_PATH') + : dirname(__DIR__) . '/../..') + ); // Define application environment defined('APPLICATION_ENV') - || define('APPLICATION_ENV', (getenv('VUFIND_ENV') ? getenv('VUFIND_ENV') : 'testing')); + || define( + 'APPLICATION_ENV', + (getenv('VUFIND_ENV') ? getenv('VUFIND_ENV') : 'testing') + ); + +// Define default search backend identifier +defined('DEFAULT_SEARCH_BACKEND') || define('DEFAULT_SEARCH_BACKEND', 'VuFind'); // Define path to local override directory defined('LOCAL_OVERRIDE_DIR') - || define('LOCAL_OVERRIDE_DIR', (getenv('VUFIND_LOCAL_DIR') ? getenv('VUFIND_LOCAL_DIR') : '')); + || define( + 'LOCAL_OVERRIDE_DIR', + (getenv('VUFIND_LOCAL_DIR') ? getenv('VUFIND_LOCAL_DIR') : '') + ); + +// Define path to cache directory +defined('LOCAL_CACHE_DIR') + || define( + 'LOCAL_CACHE_DIR', + (getenv('VUFIND_CACHE_DIR') + ? getenv('VUFIND_CACHE_DIR') : LOCAL_OVERRIDE_DIR . '/cache') + ); chdir(APPLICATION_PATH);