From 06f945f27840b53e57795dadbc38e76f7e11ab1c Mon Sep 17 00:00:00 2001 From: Horus3 Date: Mon, 24 Feb 2014 16:42:14 +0100 Subject: init --- zend/tests/TestHelper.php | 131 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 131 insertions(+) create mode 100644 zend/tests/TestHelper.php (limited to 'zend/tests/TestHelper.php') diff --git a/zend/tests/TestHelper.php b/zend/tests/TestHelper.php new file mode 100644 index 0000000..9b46cfd --- /dev/null +++ b/zend/tests/TestHelper.php @@ -0,0 +1,131 @@ +=')) { + if (version_compare($phpunitVersion, '3.6.0', '>=')) { + echo <<= PHPUnit 3.5.5 +} else { + require_once 'PHPUnit/Framework.php'; // < PHPUnit 3.5.5 +} + +/* + * Set error reporting to the level to which Zend Framework code must comply. + */ +error_reporting(E_ALL | E_STRICT); + +/* + * Determine the root, library, and tests directories of the framework + * distribution. + */ +$zfRoot = realpath(dirname(dirname(__FILE__))); +$zfCoreLibrary = "$zfRoot/library"; +$zfCoreTests = "$zfRoot/tests"; + +/* + * Prepend the Zend Framework library/ and tests/ directories to the + * include_path. This allows the tests to run out of the box and helps prevent + * loading other copies of the framework code and tests that would supersede + * this copy. + */ +$path = array( + $zfCoreLibrary, + $zfCoreTests, + get_include_path() + ); +set_include_path(implode(PATH_SEPARATOR, $path)); + +/* + * Load the user-defined test configuration file, if it exists; otherwise, load + * the default configuration. + */ +if (is_readable($zfCoreTests . DIRECTORY_SEPARATOR . 'TestConfiguration.php')) { + require_once $zfCoreTests . DIRECTORY_SEPARATOR . 'TestConfiguration.php'; +} else { + require_once $zfCoreTests . DIRECTORY_SEPARATOR . 'TestConfiguration.php.dist'; +} + +/** + * Start output buffering, if enabled + */ +if (defined('TESTS_ZEND_OB_ENABLED') && constant('TESTS_ZEND_OB_ENABLED')) { + ob_start(); +} + +/* + * Unset global variables that are no longer needed. + */ +unset($zfRoot, $zfCoreLibrary, $zfCoreTests, $path); + +// Suppress DateTime warnings +date_default_timezone_set(@date_default_timezone_get()); + -- cgit v1.2.3