mirror of
https://github.com/guzzle/guzzle.git
synced 2025-02-24 18:13:00 +01:00
1. Adopting a marker interface for Guzzle exceptions. A. All exceptions emitted from Guzzle are now wrapped with a Guzzle namespaced exception. B. Guzzle\Common\GuzzleExceptionInterface was renamed to Guzzle\Common\GuzzleException C. Guzzle\Common\ExceptionCollection was renamed to Guzzle\Common\Exception\ExceptionCollection 2. Using Header objects for Request and Response objects A. When you call $request->getHeader('X'), you will get back a Guzzle\Http\Message\Header object that contains all of the headers that case insensitively match. This object can be cast to a string or iterated like an array. You can pass true in the second argument to retrieve the header as a string. B. Removing the old Guzzle\Common\Collection based searching arguments from most of the request and response header methods. All retrievals are case-insensitive and return Header objects. 3. Changing the two headers added by the cache plugin to just one header with key and ttl. 4. Changing Guzzle\Http\Message\Response::factory() to fromMessage(). 5. Removing the NullObject return value from ServiceDescriptions and instead simply returning null New Features / enhancements: 1. Adding Guzzle\Http\Message\AbstractMessage::addHeaders() 2. Making it simpler to create service descriptions using a unified factory method that delegates to other factories. 3. Better handling of ports and hosts in Guzzle\Http\Url Note: This is a noisy diff because I'm removing trailing whitespace and adding a new line at the end of each source file.
30 lines
1.3 KiB
PHP
30 lines
1.3 KiB
PHP
<?php
|
|
|
|
error_reporting(E_ALL | E_STRICT);
|
|
|
|
// Ensure that composer has installed all dependencies
|
|
if (!file_exists(dirname(__DIR__) . DIRECTORY_SEPARATOR . 'composer.lock')) {
|
|
die("Dependencies must be installed using composer:\n\nphp composer.phar install --dev\n\n"
|
|
. "See http://getcomposer.org for help with installing composer\n");
|
|
}
|
|
|
|
require_once 'PHPUnit/TextUI/TestRunner.php';
|
|
|
|
// Inclue the phar files if testing against the phars
|
|
if (get_cfg_var('guzzle_phar')) {
|
|
require get_cfg_var('guzzle_phar');
|
|
}
|
|
|
|
// Include the composer autoloader
|
|
require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . '.composer' . DIRECTORY_SEPARATOR . 'autoload.php';
|
|
|
|
// Add the services file to the default service builder
|
|
$servicesFile = __DIR__ . DIRECTORY_SEPARATOR . 'Guzzle' . DIRECTORY_SEPARATOR . 'Tests' . DIRECTORY_SEPARATOR . 'TestData' . DIRECTORY_SEPARATOR . 'services.xml';
|
|
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());
|