|
13 | 13 | */
|
14 | 14 | error_reporting(E_ALL | E_STRICT);
|
15 | 15 |
|
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)); |
36 | 16 |
|
37 | 17 | /**
|
38 | 18 | * Setup autoloading
|
39 | 19 | */
|
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. |
54 | 22 |
|
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: |
63 | 25 |
|
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 |
70 | 27 |
|
71 |
| - unset($codeCoverageFilter); |
| 28 | +After that, you should be able to run tests.'); |
72 | 29 | }
|
73 | 30 |
|
| 31 | +include_once __DIR__ . '/../vendor/autoload.php'; |
74 | 32 |
|
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. |
77 | 36 | */
|
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'; |
80 | 41 | }
|
81 | 42 |
|
82 |
| -/* |
83 |
| - * Unset global variables that are no longer needed. |
84 |
| - */ |
85 |
| -unset($zfRoot, $zfCoreLibrary, $zfCoreTests, $path); |
0 commit comments