From 1cf4732f493d80a7bb43a05be79298a87c45b3ca Mon Sep 17 00:00:00 2001 From: Demian Katz <demian.katz@villanova.edu> Date: Mon, 30 Jul 2012 15:55:38 -0400 Subject: [PATCH] Adjust test bootstrap for proper include path. --- tests/bootstrap.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/bootstrap.php b/tests/bootstrap.php index e85712d6b03..92d5d924987 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -20,6 +20,14 @@ defined('LOCAL_OVERRIDE_DIR') chdir(APPLICATION_PATH); +// Ensure vendor/ is on include_path; some PEAR components may not load correctly +// otherwise (i.e. File_MARC may cause a "Cannot redeclare class" error by pulling +// from the shared PEAR directory instead of the local copy): +$pathParts = array(); +$pathParts[] = APPLICATION_PATH . '/vendor'; +$pathParts[] = get_include_path(); +set_include_path(implode(PATH_SEPARATOR, $pathParts)); + // Composer autoloading if (file_exists('vendor/autoload.php')) { $loader = include 'vendor/autoload.php'; -- GitLab