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 static function setUpBeforeClass() { // increase memory limit to avoid fatal error due to findPetByStatus // returning a lot of data ini_set('memory_limit', '256M'); // for error reporting (need to run with php5.3 to get no warning) //ini_set('display_errors', 1); //error_reporting(~0); // when running with php5.5, comment out below to skip the warning about // using @ to handle file upload //ini_set('display_startup_errors',1); //ini_set('display_errors',1); //error_reporting(-1); // enable debugging //Configuration::$debug = true; // skip initializing the API client as it should be automatic //$api_client = new ApiClient('http://petstore.swagger.io/v2'); // 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->setPhotoUrls(array("http://test_php_unit_test.com")); // 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); }