fix php map, add test case for get inventory

This commit is contained in:
wing328
2015-06-05 13:16:30 +08:00
parent 59ca8bd986
commit d0f9345c5a
3 changed files with 21 additions and 9 deletions

View File

@@ -181,7 +181,7 @@ class PetApiTest extends \PHPUnit_Framework_TestCase
$this->assertSame($response->name, 'PHP Unit Test');
}
// test
// test upload file
public function testUploadFile()
{
// initialize the API client
@@ -194,6 +194,20 @@ class PetApiTest extends \PHPUnit_Framework_TestCase
$this->assertSame($add_response, NULL);
}
// test get inventory
public function testGetInventory()
{
// initialize the API client
$api_client = new SwaggerClient\APIClient('http://petstore.swagger.io/v2');
$store_api = new SwaggerClient\StoreAPI($api_client);
// get inventory
$get_response = $store_api->getInventory();
$this->assertInternalType("int", $get_response['sold']);
$this->assertInternalType("int", $get_response['pending']);
}
}
?>