forked from loafle/openapi-generator-original
update php api test with SwaggerClient.php
This commit is contained in:
parent
676c4d0835
commit
c30ed059fe
@ -1,13 +1,13 @@
|
|||||||
<?php
|
<?php
|
||||||
require_once('SwaggerPetstore.php');
|
require_once('SwaggerClient.php');
|
||||||
class PetApiTest extends \PHPUnit_Framework_TestCase
|
class PetApiTest extends \PHPUnit_Framework_TestCase
|
||||||
{
|
{
|
||||||
public function testGetPetById()
|
public function testGetPetById()
|
||||||
{
|
{
|
||||||
// initialize the API client
|
// initialize the API client
|
||||||
$api_client = new SwaggerPetstore\APIClient('http://petstore.swagger.io/v2');
|
$api_client = new SwaggerClient\APIClient('http://petstore.swagger.io/v2');
|
||||||
$petId = 10005; // ID of pet that needs to be fetched
|
$petId = 10005; // ID of pet that needs to be fetched
|
||||||
$pet_api = new SwaggerPetstore\PetAPI($api_client);
|
$pet_api = new SwaggerClient\PetAPI($api_client);
|
||||||
// return Pet (model)
|
// return Pet (model)
|
||||||
$response = $pet_api->getPetById($petId);
|
$response = $pet_api->getPetById($petId);
|
||||||
$this->assertSame($response->id, $petId);
|
$this->assertSame($response->id, $petId);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user