From 5bb2c5c26f773e08d88c5e37d37f68fdf01e77d6 Mon Sep 17 00:00:00 2001 From: Uwe Tews Date: Thu, 21 May 2015 00:53:04 +0200 Subject: [PATCH] Update bootstrap --- tests/Bootstrap.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) 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;