public static function setUpBeforeClass()
 {
     // for error reporting (need to run with php5.3 to get no warning)
     //ini_set('display_errors', 1);
     //error_reporting(~0);
     // new pet
     $new_pet_id = 10005;
     $new_pet = new Model\Pet();
     $new_pet->setId($new_pet_id);
     $new_pet->setName("PHP Unit Test");
     $new_pet->setStatus("available");
     // new tag
     $tag = new Model\Tag();
     $tag->setId($new_pet_id);
     // use the same id as pet
     $tag->setName("test php tag");
     // new category
     $category = new Model\Category();
     $category->setId($new_pet_id);
     // use the same id as pet
     $category->setName("test php category");
     $new_pet->setTags(array($tag));
     $new_pet->setCategory($category);
     $pet_api = new Api\PetAPI();
     // add a new pet (model)
     $add_response = $pet_api->addPet($new_pet);
 }
 public function testUpdatePet()
 {
     // initialize the API client
     $config = (new Configuration())->setHost('http://petstore.swagger.io/v2');
     $api_client = new ApiClient($config);
     $pet_id = 10001;
     // ID of pet that needs to be fetched
     $pet_api = new Api\PetApi($api_client);
     // create updated pet object
     $updated_pet = new Model\Pet();
     $updated_pet->setId($pet_id);
     $updated_pet->setName('updatePet');
     // new name
     $updated_pet->setStatus('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->getId(), $pet_id);
     $this->assertSame($response->getStatus(), 'pending');
     $this->assertSame($response->getName(), 'updatePet');
 }