[CHANGED] "tests/bootstrap.php".

This commit is contained in:
Roman Syroeshko 2014-10-14 21:06:47 +04:00
parent 2c81d5f38b
commit 06d6b715a3
1 changed files with 4 additions and 10 deletions

View File

@ -23,16 +23,10 @@ if (!defined('PHPWORD_TESTS_BASE_DIR')) {
} }
$vendor = realpath(__DIR__ . '/../vendor'); $vendor = realpath(__DIR__ . '/../vendor');
if (file_exists($vendor . '/autoload.php')) {
if (file_exists($vendor . "/autoload.php")) { require $vendor . '/autoload.php';
require $vendor . "/autoload.php";
} else { } else {
$vendor = realpath(__DIR__ . '/../../../'); throw new Exception('Unable to load dependencies');
if (file_exists($vendor . "/autoload.php")) {
require $vendor . "/autoload.php";
} else {
throw new Exception("Unable to load dependencies");
}
} }
spl_autoload_register(function ($class) { spl_autoload_register(function ($class) {
@ -49,5 +43,5 @@ spl_autoload_register(function ($class) {
} }
}); });
require_once __DIR__ . "/../src/PhpWord/Autoloader.php"; require_once __DIR__ . '/../src/PhpWord/Autoloader.php';
\PhpOffice\PhpWord\Autoloader::register(); \PhpOffice\PhpWord\Autoloader::register();