Skip to content
This repository was archived by the owner on Oct 16, 2019. It is now read-only.

Commit ce96307

Browse files
committed
Remove obsolete testing setup
1 parent cfdf50b commit ce96307

File tree

5 files changed

+35
-111
lines changed

5 files changed

+35
-111
lines changed

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@
5252
"upload-coverage": "coveralls -v",
5353
"cs-check": "php-cs-fixer fix -v --diff --dry-run",
5454
"cs-fix": "php-cs-fixer fix -v --diff",
55-
"test": "phpunit --colors=always -c ./tests",
56-
"test-coverage": "phpunit --coverage-clover clover.xml -c ./tests",
55+
"test": "phpunit --colors=always",
56+
"test-coverage": "phpunit --coverage-clover clover.xml",
5757
"license-check": "true"
5858
}
5959
}

phpunit.xml.dist

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<phpunit bootstrap="./tests/Bootstrap.php" colors="true">
2+
<testsuites>
3+
<testsuite name="ZendService Amazon Test Suite">
4+
<directory>./tests/ZendService</directory>
5+
</testsuite>
6+
</testsuites>
7+
8+
<groups>
9+
<exclude>
10+
<group>disable</group>
11+
</exclude>
12+
</groups>
13+
14+
<filter>
15+
<whitelist addUncoveredFilesFromWhitelist="true">
16+
<directory suffix=".php">./library</directory>
17+
</whitelist>
18+
</filter>
19+
</phpunit>

tests/Bootstrap.php

Lines changed: 14 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -13,73 +13,30 @@
1313
*/
1414
error_reporting(E_ALL | E_STRICT);
1515

16-
/*
17-
* Determine the root, library, and tests directories of the framework
18-
* distribution.
19-
*/
20-
$zfRoot = realpath(dirname(__DIR__));
21-
$zfCoreLibrary = "$zfRoot/library";
22-
$zfCoreTests = "$zfRoot/tests";
23-
24-
/*
25-
* Prepend the Zend Framework library/ and tests/ directories to the
26-
* include_path. This allows the tests to run out of the box and helps prevent
27-
* loading other copies of the framework code and tests that would supersede
28-
* this copy.
29-
*/
30-
$path = array(
31-
$zfCoreLibrary,
32-
$zfCoreTests,
33-
get_include_path(),
34-
);
35-
set_include_path(implode(PATH_SEPARATOR, $path));
3616

3717
/**
3818
* Setup autoloading
3919
*/
40-
include __DIR__ . '/_autoload.php';
41-
42-
/*
43-
* Load the user-defined test configuration file, if it exists; otherwise, load
44-
* the default configuration.
45-
*/
46-
if (is_readable($zfCoreTests . DIRECTORY_SEPARATOR . 'TestConfiguration.php')) {
47-
require_once $zfCoreTests . DIRECTORY_SEPARATOR . 'TestConfiguration.php';
48-
} else {
49-
require_once $zfCoreTests . DIRECTORY_SEPARATOR . 'TestConfiguration.php.dist';
50-
}
51-
52-
if (defined('TESTS_GENERATE_REPORT') && TESTS_GENERATE_REPORT === true) {
53-
$codeCoverageFilter = PHP_CodeCoverage_Filter::getInstance();
20+
if (!file_exists(__DIR__ . '/../vendor/autoload.php')) {
21+
throw new RuntimeException('This component has dependencies that are unmet.
5422
55-
$lastArg = end($_SERVER['argv']);
56-
if (is_dir($zfCoreTests . '/' . $lastArg)) {
57-
$codeCoverageFilter->addDirectoryToWhitelist($zfCoreLibrary . '/' . $lastArg);
58-
} elseif (is_file($zfCoreTests . '/' . $lastArg)) {
59-
$codeCoverageFilter->addDirectoryToWhitelist(dirname($zfCoreLibrary . '/' . $lastArg));
60-
} else {
61-
$codeCoverageFilter->addDirectoryToWhitelist($zfCoreLibrary);
62-
}
23+
Please install composer (http://getcomposer.org), and run the following
24+
command in the root of this project:
6325
64-
/*
65-
* Omit from code coverage reports the contents of the tests directory
66-
*/
67-
$codeCoverageFilter->addDirectoryToBlacklist($zfCoreTests, '');
68-
$codeCoverageFilter->addDirectoryToBlacklist(PEAR_INSTALL_DIR, '');
69-
$codeCoverageFilter->addDirectoryToBlacklist(PHP_LIBDIR, '');
26+
php /path/to/composer.phar install
7027
71-
unset($codeCoverageFilter);
28+
After that, you should be able to run tests.');
7229
}
7330

31+
include_once __DIR__ . '/../vendor/autoload.php';
7432

75-
/**
76-
* Start output buffering, if enabled
33+
/*
34+
* Load the user-defined test configuration file, if it exists; otherwise, load
35+
* the default configuration.
7736
*/
78-
if (defined('TESTS_ZEND_OB_ENABLED') && constant('TESTS_ZEND_OB_ENABLED')) {
79-
ob_start();
37+
if (is_readable(__DIR__ . '/TestConfiguration.php')) {
38+
require_once __DIR__ . '/TestConfiguration.php';
39+
} else {
40+
require_once __DIR__ . '/TestConfiguration.php.dist';
8041
}
8142

82-
/*
83-
* Unset global variables that are no longer needed.
84-
*/
85-
unset($zfRoot, $zfCoreLibrary, $zfCoreTests, $path);

tests/_autoload.php

Lines changed: 0 additions & 39 deletions
This file was deleted.

tests/phpunit.xml.dist

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)