2011-02-28 22:30:22 -06:00
|
|
|
<?php
|
|
|
|
|
|
|
|
error_reporting(E_ALL | E_STRICT);
|
|
|
|
|
2012-01-14 13:57:05 -06:00
|
|
|
// Ensure that composer has installed all dependencies
|
2012-04-14 18:43:34 -07:00
|
|
|
if (!file_exists(dirname(__DIR__) . DIRECTORY_SEPARATOR . 'composer-test.lock')) {
|
|
|
|
die("Dependencies must be installed using composer:\n\nCOMPOSER=composer-test.json composer.phar install\n\n"
|
2012-01-14 13:57:05 -06:00
|
|
|
. "See https://github.com/composer/composer/blob/master/README.md for help with installing composer\n");
|
|
|
|
}
|
|
|
|
|
2011-02-28 22:30:22 -06:00
|
|
|
require_once 'PHPUnit/TextUI/TestRunner.php';
|
|
|
|
|
2012-04-14 18:43:34 -07:00
|
|
|
// Inclue the phar files if testing against the phars
|
|
|
|
if (get_cfg_var('guzzle_phar')) {
|
|
|
|
require get_cfg_var('guzzle_phar');
|
|
|
|
}
|
|
|
|
|
2012-01-14 13:57:05 -06:00
|
|
|
// Include the composer autoloader
|
2012-01-15 12:31:00 -06:00
|
|
|
require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . '.composer' . DIRECTORY_SEPARATOR . 'autoload.php';
|
2011-02-28 22:30:22 -06:00
|
|
|
|
2012-01-14 13:57:05 -06:00
|
|
|
// Add the services file to the default service builder
|
|
|
|
$servicesFile = __DIR__ . DIRECTORY_SEPARATOR . 'Guzzle' . DIRECTORY_SEPARATOR . 'Tests' . DIRECTORY_SEPARATOR . 'TestData' . DIRECTORY_SEPARATOR . 'services.xml';
|
2012-04-14 19:04:37 -07:00
|
|
|
Guzzle\Tests\GuzzleTestCase::setServiceBuilder(Guzzle\Service\ServiceBuilder::factory($servicesFile));
|
|
|
|
|
|
|
|
// Modify the include path so that it can find the Zend Framework
|
|
|
|
$paths = array('vendor/zend/zend-cache1', 'vendor/zend/zend-log1');
|
|
|
|
set_include_path(implode(PATH_SEPARATOR, array_map(function($path) {
|
|
|
|
return __DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . $path;
|
|
|
|
}, $paths)) . PATH_SEPARATOR . get_include_path() );
|