This repository has been archived by the owner on Apr 13, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Bootstrap.php
49 lines (43 loc) · 1.76 KB
/
Bootstrap.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php
/*
* This file is part of the Smarty PHPUnit tests.
*
*/
/*
* Smarty PHPUnit Bootstrap
*/
include_once dirname(__FILE__) . '/Config.php';
if (!class_exists('Smarty_Autoloader')) {
if (is_file(dirname(__FILE__) . '/../smarty/libs/bootstrap.php')) {
require_once dirname(__FILE__) . '/../smarty/libs/bootstrap.php';
} elseif (is_file(dirname(__FILE__) . '/../libs/bootstrap.php')) {
require_once dirname(__FILE__) . '/../libs/bootstrap.php';
} else {
throw new Exception('can not locate Smarty distribution');
}
}
if (!defined('SMARTY_COMPOSER_INSTALL')) {
foreach (array(dirname(__FILE__) . '/../../autoload.php', dirname(__FILE__) . '/../vendor/autoload.php',
dirname(__FILE__) . '/vendor/autoload.php') as $file) {
if (file_exists($file)) {
define('SMARTY_COMPOSER_INSTALL', $file);
break;
}
}
unset($file);
}
if (!class_exists('PHPUnit_Framework_TestCase') && !class_exists('\PHPUnit\Framework\TestCase')){
require_once SMARTY_COMPOSER_INSTALL;
}
if (!class_exists('\PHPUnit_Framework_TestCase') && class_exists('\PHPUnit\Framework\TestCase')) {
class_alias('\PHPUnit\Framework\TestCase', '\PHPUnit_Framework_TestCase');
class_alias('\PHPUnit\Framework\Error\Notice', '\PHPUnit_Framework_Error_Notice');
class_alias('\PHPUnit\Framework\Error\Error', '\PHPUnit_Framework_Error_Error');
class_alias('\PHPUnit\Framework\Error\Warning', '\PHPUnit_Framework_Error_Warning');
class_alias('\PHPUnit\Framework\Error\Warning', '\PHPUnit_Framework_Error_Deprecated');
class_alias('\PHPUnit\Util\Configuration', '\PHPUnit_Util_Configuration');
}
require_once 'PHPUnit_Smarty.php';
if (!ini_get('date.timezone')) {
ini_set('date.timezone', 'Europe/Berlin');
}