From a8f5809370c80558b8a3ae8bb06cb403cc8de0ee Mon Sep 17 00:00:00 2001 From: wing328 Date: Fri, 8 Jan 2016 14:04:10 +0800 Subject: [PATCH] replace httpHeader with httpHeaders in php object serializer --- .../src/main/resources/php/ObjectSerializer.mustache | 6 +++--- .../src/test/java/io/swagger/petstore/test/PetApiTest.java | 5 +++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/php/ObjectSerializer.mustache b/modules/swagger-codegen/src/main/resources/php/ObjectSerializer.mustache index ea53467127d..f53416e4c52 100644 --- a/modules/swagger-codegen/src/main/resources/php/ObjectSerializer.mustache +++ b/modules/swagger-codegen/src/main/resources/php/ObjectSerializer.mustache @@ -199,11 +199,11 @@ class ObjectSerializer * * @param mixed $data object or primitive to be deserialized * @param string $class class name is passed as a string - * @param string $httpHeader HTTP headers + * @param string $httpHeaders HTTP headers * * @return object an instance of $class */ - public function deserialize($data, $class, $httpHeader=null) + public function deserialize($data, $class, $httpHeaders=null) { if (null === $data) { $deserialized = null; @@ -231,7 +231,7 @@ class ObjectSerializer $deserialized = $data; } elseif ($class === '\SplFileObject') { // determine file name - if (array_key_exists('Content-Disposition', $httpHeader) && preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeader['Content-Disposition'], $match)) { + if (array_key_exists('Content-Disposition', $httpHeaders) && preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match)) { $filename = Configuration::getDefaultConfiguration()->getTempFolderPath().$match[1]; } else { $filename = tempnam(Configuration::getDefaultConfiguration()->getTempFolderPath(), ''); diff --git a/samples/client/petstore/android/default/src/test/java/io/swagger/petstore/test/PetApiTest.java b/samples/client/petstore/android/default/src/test/java/io/swagger/petstore/test/PetApiTest.java index ca868d2ea22..75039a9fa39 100644 --- a/samples/client/petstore/android/default/src/test/java/io/swagger/petstore/test/PetApiTest.java +++ b/samples/client/petstore/android/default/src/test/java/io/swagger/petstore/test/PetApiTest.java @@ -72,6 +72,11 @@ public class PetApiTest { } @Test + @Ignore + /* ignoring the findPetByTags test below as it's very similar to + * testFindPetsByStatus and testFindPetsByTags sometimes got 500 + * due to server issue, which makes the test unstable. + */ public void testFindPetsByTags() throws Exception { Pet pet = createRandomPet(); pet.setName("monster");