mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-07-04 14:40:53 +00:00
update php api test with SwaggerClient.php
This commit is contained in:
parent
676c4d0835
commit
c30ed059fe
@ -1,13 +1,13 @@
|
||||
<?php
|
||||
require_once('SwaggerPetstore.php');
|
||||
require_once('SwaggerClient.php');
|
||||
class PetApiTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
public function testGetPetById()
|
||||
{
|
||||
// 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
|
||||
$pet_api = new SwaggerPetstore\PetAPI($api_client);
|
||||
$pet_api = new SwaggerClient\PetAPI($api_client);
|
||||
// return Pet (model)
|
||||
$response = $pet_api->getPetById($petId);
|
||||
$this->assertSame($response->id, $petId);
|
||||
|
Loading…
x
Reference in New Issue
Block a user