diff --git a/samples/client/petstore/php/SwaggerClient-php/tests/PetApiTest.php b/samples/client/petstore/php/SwaggerClient-php/tests/PetApiTest.php index c29b6d2686f..500b03896a0 100644 --- a/samples/client/petstore/php/SwaggerClient-php/tests/PetApiTest.php +++ b/samples/client/petstore/php/SwaggerClient-php/tests/PetApiTest.php @@ -373,6 +373,17 @@ public function testDefaultValues() $this->assertSame('red', $animal->getColor()); } + /** + * test invalid argument + * + * @expectedException \InvalidArgumentException + */ + public function testInvalidArgument() + { + // the argument is required, and we must specify one or some from 'available', 'pending', 'sold' + $this->api->findPetsByStatus([]); + } + // Disabled as currently we don't have any endpoint that would return file // For testing I just replaced url and return type in Api method. // public function testDownloadingLargeFile() diff --git a/samples/client/petstore/php/SwaggerClient-php/tests/StoreApiTest.php b/samples/client/petstore/php/SwaggerClient-php/tests/StoreApiTest.php index f413737461c..4be179c2bc7 100644 --- a/samples/client/petstore/php/SwaggerClient-php/tests/StoreApiTest.php +++ b/samples/client/petstore/php/SwaggerClient-php/tests/StoreApiTest.php @@ -18,43 +18,7 @@ public function testGetInventory() { $result = $this->api->getInventory(); - $this->assertInternalType("array", $result); - $this->assertInternalType("int", $result['available']); + $this->assertInternalType('array', $result); + $this->assertInternalType('int', $result['available']); } - - /* - * comment out as we've removed invalid endpoints from the spec, we'll introduce something - * similar in the future when we've time to update the petstore server - * - // test get inventory - public function testGetInventoryInObject() - { - $result = $this->api->getInventoryInObject(); - - $this->assertInternalType("array", $result); - $this->assertInternalType("int", $result['available']); - } - */ - - /** - * test empty array response - * - * Make sure empty arrays from a producer is actually returned as - * an empty array and not some other value. At some point it was - * returned as null because the code stumbled on PHP loose type - * checking (not on empty array is true, same thing could happen - * with careless use of empty()). - */ -// public function testEmptyArrayResponse() -// { -// // this call returns and empty array -// $response = $this->api->findPetsByStatus(array()); -// -// // make sure this is an array as we want it to be -// $this->assertInternalType("array", $response); -// -// // make sure the array is empty just in case the petstore -// // server changes its output -// $this->assertEmpty($response); -// } }