Skip to content

Commit ea83434

Browse files
author
Michael Babker
committed
Clean up the unit test command a bit, update test environment
1 parent 64e6bf6 commit ea83434

File tree

7 files changed

+21
-94
lines changed

7 files changed

+21
-94
lines changed

.travis.yml

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ language: php
33
php:
44
- 5.4
55
- 5.5
6+
- 5.6
7+
- 7.0
68

79
env: JTRACKER_ENVIRONMENT=travis
810

cli/Application/Command/Test/Phpunit.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public function execute()
3939
$command = new PHPUnit_TextUI_Command;
4040

4141
$options = [
42-
'--configuration=' . JPATH_ROOT . '/phpunit.travis.xml'
42+
'--configuration=' . JPATH_ROOT . '/phpunit.xml'
4343
];
4444

4545
$returnVal = $command->run($options, false);

phpunit.travis.xml

-37
This file was deleted.

phpunit.xml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phpunit bootstrap="tests/bootstrap.php" colors="false">
3+
<testsuites>
4+
<testsuite name="Unit">
5+
<directory>tests/tracker</directory>
6+
</testsuite>
7+
</testsuites>
8+
</phpunit>

phpunit.xml.dist

-38
This file was deleted.

tests/bootstrap.php

+10-18
Original file line numberDiff line numberDiff line change
@@ -7,31 +7,23 @@
77
* @link http://www.phpunit.de/manual/current/en/installation.html
88
*/
99

10-
// Fix magic quotes.
11-
@ini_set('magic_quotes_runtime', 0);
12-
1310
// Maximise error reporting.
1411
error_reporting(-1);
1512
ini_set('display_errors', 1);
1613

1714
/*
1815
* Ensure that required path constants are defined.
1916
*/
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');
2421

25-
// Register the test classes.
26-
$loader = require __DIR__ . '/../vendor/autoload.php';
22+
$composerPath = JPATH_ROOT . '/vendor/autoload.php';
2723

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+
}
3028

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';

tests/tracker/themes_base/.gitignore

Whitespace-only changes.

0 commit comments

Comments
 (0)