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:
parent
c39e0b2c39
commit
412402a3d9
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user