diff --git a/tests/Bootstrap.php b/tests/Bootstrap.php index 02e6f321..baf22860 100644 --- a/tests/Bootstrap.php +++ b/tests/Bootstrap.php @@ -6,17 +6,23 @@ /* * Smarty PHPUnit Bootstrap */ -// Locate SmartyBC class and load it +// Locate Autoloader or SmartyBC class and load it if (is_file(__DIR__ . '/../smarty/libs/Autoloader.php')) { require_once __DIR__ . '/../smarty/libs/Autoloader.php'; + Smarty_Autoloader::register(true); } elseif (is_file(__DIR__ . '/../libs/Autoloader.php')) { require_once __DIR__ . '/../libs/Autoloader.php'; + Smarty_Autoloader::register(true); +} elseif (is_file(__DIR__ . '/../smarty/libs/SmartyBC.class.php')) { + require_once __DIR__ . '/../smarty/libs/SmartyBC.class.php'; +} elseif (is_file(__DIR__ . '/../libs/SmartyBC.class.php')) { + require_once __DIR__ . '/../libs/SmartyBC.class.php'; } else { throw new Exception('can not locate Smarty distribution'); } -Smarty_Autoloader::register(true); if (!defined('SMARTY_COMPOSER_INSTALL')) { - foreach (array(__DIR__ . '/../../autoload.php', __DIR__ . '/../vendor/autoload.php', __DIR__ . '/vendor/autoload.php') as $file) { + foreach (array(__DIR__ . '/../../autoload.php', __DIR__ . '/../vendor/autoload.php', + __DIR__ . '/vendor/autoload.php') as $file) { if (file_exists($file)) { define('SMARTY_COMPOSER_INSTALL', $file); break;