egeloen/ivory-http-adapter — pull request #51 by jeromegamez (2014-12-23 01:04:06+00:00)
Title: Enable baseUrl support for GuzzleHttpHttpAdapter

GuzzleHttp allows the definition of a base URL when creating a Client:

```php
use GuzzleHttp\Client;
use Ivory\HttpAdapter\GuzzleHttpHttpAdapter;

$client = new Client(array('base_url' => 'http://api.example.com'));
$http = new GuzzleHttpHttpAdapter($client);

$response = $http->get('/');
```
The last call will throw the following exception:
```bash
Ivory\HttpAdapter\HttpAdapterException: The url "/" is not valid.
```
because somewhere along the way, [`UrlNormalizer::normalize($url)`](https://github.com/egeloen/ivory-http-adapter/blob/master/src/Normalizer/UrlNormalizer.php#L35) expects an absolute URL, but receives the relative one.

This PR wants to add the following behavior to the `GuzzleHttpHttpAdapter`
- If a base URL has been set in the client, combine the given URL with the base URL from the client
- If a base URL has been set, but the given URL is an absolute URL matching the base URL, don't combine them.

A test is also included (I hope I have put it in the right location :))

Cheers
:octocat: Jérôme