1
0
mirror of https://github.com/guzzle/guzzle.git synced 2025-02-25 02:22:57 +01:00

Clients do not require base_url in factory

This commit is contained in:
Michael Dowling 2012-10-23 21:24:09 -07:00
parent c39e0b2c39
commit 412402a3d9
2 changed files with 9 additions and 1 deletions

View File

@ -59,7 +59,7 @@ class Client extends HttpClient implements ClientInterface
*/
public static function factory($config = array())
{
return new static($config['base_url'], $config);
return new static(isset($config['base_url']) ? $config['base_url'] : null, $config);
}
/**

View File

@ -54,6 +54,14 @@ class ClientTest extends \Guzzle\Tests\GuzzleTestCase
$this->assertEquals('123', $client->getConfig('test'));
}
/**
* @covers Guzzle\Service\Client::factory
*/
public function testFactoryDoesNotRequireBaseUrl()
{
$client = Client::factory();
}
/**
* @covers Guzzle\Service\Client::getAllEvents
*/