|
7 | 7 | * @link http://www.phpunit.de/manual/current/en/installation.html
|
8 | 8 | */
|
9 | 9 |
|
10 |
| -// Fix magic quotes. |
11 |
| -@ini_set('magic_quotes_runtime', 0); |
12 |
| - |
13 | 10 | // Maximise error reporting.
|
14 | 11 | error_reporting(-1);
|
15 | 12 | ini_set('display_errors', 1);
|
16 | 13 |
|
17 | 14 | /*
|
18 | 15 | * Ensure that required path constants are defined.
|
19 | 16 | */
|
20 |
| -define('JPATH_TESTS', realpath(__DIR__)); |
21 |
| -defined('JPATH_ROOT') || define('JPATH_ROOT', realpath(JPATH_TESTS . '/tmp')); |
22 |
| -define('JPATH_THEMES', JPATH_TESTS . '/themes_base'); |
23 |
| - |
| 17 | +defined('JPATH_ROOT') || define('JPATH_ROOT', realpath(dirname(__DIR__))); |
| 18 | +define('JPATH_CONFIGURATION', JPATH_ROOT . '/etc'); |
| 19 | +define('JPATH_THEMES', JPATH_ROOT . '/www'); |
| 20 | +define('JPATH_TEMPLATES', JPATH_ROOT . '/templates'); |
24 | 21 |
|
25 |
| -// Register the test classes. |
26 |
| -$loader = require __DIR__ . '/../vendor/autoload.php'; |
| 22 | +$composerPath = JPATH_ROOT . '/vendor/autoload.php'; |
27 | 23 |
|
28 |
| -// Add the namespace for our application to the autoloader. |
29 |
| -$loader->add('Test', __DIR__); |
| 24 | +if (!file_exists($composerPath)) |
| 25 | +{ |
| 26 | + throw new RuntimeException('Composer is not set up, please run "composer install".'); |
| 27 | +} |
30 | 28 |
|
31 |
| -/* |
32 |
| - * The PHP garbage collector can be too aggressive in closing circular references before they are no longer needed. This can cause |
33 |
| - * segfaults during long, memory-intensive processes such as testing large test suites and collecting coverage data. We explicitly |
34 |
| - * disable garbage collection during the execution of PHPUnit processes so that we (hopefully) don't run into these issues going |
35 |
| - * forwards. This is only a problem PHP 5.3+. |
36 |
| - */ |
37 |
| -gc_disable(); |
| 29 | +require JPATH_ROOT . '/vendor/autoload.php'; |
0 commit comments