Exemplo n.º 1
0
 public function testUpdatePet()
 {
     // initialize the API client
     $api_client = new SwaggerClient\ApiClient('http://petstore.swagger.io/v2');
     $pet_id = 10001;
     // ID of pet that needs to be fetched
     $pet_api = new SwaggerClient\PetAPI($api_client);
     // create updated pet object
     $updated_pet = new SwaggerClient\models\Pet();
     $updated_pet->id = $pet_id;
     $updated_pet->name = 'updatePet';
     // new name
     $updated_pet->status = 'pending';
     // new status
     // update Pet (model/json)
     $update_response = $pet_api->updatePet($updated_pet);
     // return nothing (void)
     $this->assertSame($update_response, NULL);
     // verify updated Pet
     $response = $pet_api->getPetById($pet_id);
     $this->assertSame($response->id, $pet_id);
     $this->assertSame($response->status, 'pending');
     $this->assertSame($response->name, 'updatePet');
 }