fix http basic auth, add test cases for new api client without host

This commit is contained in:
wing328
2015-05-20 21:55:16 +08:00
parent 9a1dedbe76
commit 6e13403a37
5 changed files with 5 additions and 17 deletions

View File

@@ -35,6 +35,7 @@ class PetApiTest extends \PHPUnit_Framework_TestCase
{
$api_client = new SwaggerClient\APIClient('http://petstore.swagger.io/v2');
SwaggerClient\Configuration::$apiKey['api_key'] = '123456';
$headerParams = array('test1' => 'value1');
$queryParams = array('test2' => 'value2');
$authSettings = array('api_key', 'unknown');
@@ -62,8 +63,8 @@ class PetApiTest extends \PHPUnit_Framework_TestCase
// test getPetById with a Pet object (id 10005)
public function testGetPetById()
{
// initialize the API client
$api_client = new SwaggerClient\APIClient('http://petstore.swagger.io/v2');
// initialize the API client without host
$api_client = new SwaggerClient\APIClient();
SwaggerClient\Configuration::$apiKey['api_key'] = '111222333444555';
$pet_id = 10005; // ID of pet that needs to be fetched
$pet_api = new SwaggerClient\PetAPI($api_client);