Akihito Nakano
d58835e571
[PHP] Improve: Make validation strict ( #7724 )
...
* Add test case which reproduce the problem
refs https://github.com/swagger-api/swagger-codegen/pull/7686#issuecomment-368200011
> 1. We should pass true as 3rd argument of in_array()
* Add test case for setter
* Strict validation
* Update samples
* Tweak expected value according to changes in #7723
2018-03-25 23:17:46 +08:00
Akihito Nakano
32cf2f16f5
[PHP] Non required enum property ( #7723 )
...
* Add required enum property
* Update samples
* Add test case which reproduce the problem
refs https://github.com/swagger-api/swagger-codegen/pull/7686#issuecomment-368200011
> 2. Non-required enum property is listed as invalid when omitted
* If the property is not empty, perform validation
* Update samples
* Use is_null() according to setter implementation
refs 377247f125/modules/swagger-codegen/src/main/resources/php/model_generic.mustache (L347)
* Update samples
2018-03-08 21:54:34 +08:00
Akihito Nakano
be14e02875
[PHP] Cleanup test ( #7673 )
...
* Regenerate PetApiTest, OrderTest
The same test code as deleted is in the 'tests' directory.
* Move test code 'test' -> 'tests', and Regenerate test/Model/PetTest.php
* Regenerate 'test' directory
rm -rf samples/client/petstore/php/SwaggerClient-php/test && bin/php-petstore.sh
2018-02-22 17:31:18 +08:00
Akihito Nakano
14e1e19803
[PHP] Improve validation on empty arrays ( #7686 )
...
* Api should throw exception if an empty array is passed
* Update samples
- bin/php-petstore.sh
- bin/security/php-petstore.sh
2018-02-22 17:15:00 +08:00
Akihito Nakano
4e5ec4c71c
[PHP] Cleanup StoreApiTest ( #7248 )
...
* Move test codes in "test" to "tests".
* Simplify class name specification
* Regenerate test/Api/StoreApiTest.php
testGetInventory already exists in tests/StoreApiTest.php
2018-01-07 11:46:31 +08:00
Akihito Nakano
50d217894c
[PHP] Cleanup EnumTest ( #7282 )
...
* Move test codes in "test" to "tests"
- EnumClassTest
- EnumTestTest
* Regenerate test/Model/Enum(Class|Test)Test.php
2018-01-07 11:42:44 +08:00
Akihito Nakano
fa3e72e6e3
[PHP] Cleanup AnimalFarmTest ( #7279 )
...
* Move test codes in "test" to "tests"
* Regenerate test/Model/AnimalFarmTest.php
2018-01-07 11:21:53 +08:00
Akihito Nakano
cfa5a55a28
[PHP] Improve StoreApiTest ( #7141 )
...
* Move the test code to the appropriate test case
* currently, InvalidArgumentException will be thrown
* Remove unnecessary tests at this time
* Unify into single quotes
2017-12-09 17:01:25 +08:00
Akihito Nakano
e8635632a4
[PHP] Fix #6770 : Debug flag is not passed ( #6808 )
...
* Add testcase which reproduces issue #6770
* Pass debug option if needed
* Update samples
* bin/php-petstore.sh
* bin/security/php-petstore.sh
* Api throws exception when failed to open debug file
* Pass debug option if needed (Async)
* Extract instance method
* Update samples
* bin/php-petstore.sh
* bin/security/php-petstore.sh
2017-11-02 17:14:00 +08:00
Akihito Nakano
07b408a44a
[PHP] Fix #5338 : InvalidArgumentException ( #6685 )
...
* Add endpoint definition which reproduces #5338 bug
* Update samples
* Add test case which reproduces #5338 bug
* Fix "InvalidArgumentException: Invalid resource type: object"
* Update samples
- ./bin/php-petstore.sh
- ./bin/security/php-petstore.sh
2017-10-17 21:22:49 +08:00
Akihito Nakano
4612c12560
[PHP] Add support for async requests ( #5771 )
...
* Add xxxAsyncWithHttpInfo
* Add xxxAsync
* Tweak doc comment
* apply DRY principle to the creation process for request
* Fix undefined variable $statusCode
* error handling
* Fix undefined variable $url
* Tweak syntax
* Update samples
run './bin/php-petstore.sh'
* Update samples (security)
run './bin/security/php-petstore.sh'
* Fix doc comment
xxx(Async|AsyncWithHttpInfo) returns \GuzzleHttp\Promise\PromiseInterface
* Update samples (./bin/php-petstore.sh)
* Update samples (./bin/security/php-petstore.sh)
* Add AsyncTest
2017-06-07 20:35:28 +08:00
wing328
87bbbc1a1b
Merge remote-tracking branch 'origin/master' into 230_merge_master
2017-06-05 23:27:11 +08:00
Arne Jørgensen
d5b3cc0534
[PHP] Fix date
format serialization ( #5754 )
...
* [PHP] Honor Swagger/OpenAPI 'date' format
Per spec
(https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#data-types ),
DateTime instances defined as 'date' datatype need to be serialized as
defined by full-date - RFC3339, which has the format:
full-date = date-fullyear "-" date-month "-" date-mday
ref:
https://xml2rfc.tools.ietf.org/public/rfc/html/rfc3339.html#anchor14
see #5531
fixes #5607
* [PHP] Add `date` and `date-time` serializer tests
See #5531
See #5607
* [PHP] Improve codestyle of generated code
* [PHP] Regenerate PHP Petstore sample
* [PHP] Regenerate PHP Security sample
2017-06-05 00:47:56 +08:00
baartosz
d7202a7c76
[php] 2.3 - fix form params json encoding ( #5701 )
...
* fixed tests expectations not compatible with phpunit 4
* added test and endpoint definition, updated template
* regenerated sample
* regenerated security sample
2017-06-05 00:36:40 +08:00
baartosz
2315ef2a7f
Php client using guzzle6 & psr7 instead of curl ( #5190 )
...
* reimplemented basic requests with httpplug
* added returning headers
* added query params support
* removed constant reference to model class
* some extra @throws; form params
* form and query params encoding
* file upload / form multipart
* added missing response headers in WithHttpInfo calls
* removed Store test From PetApiTest class
* removed configuration overriding test as its now task of client adapters
* updated store tests with new client initialization code
* updated composer.json template
* not using json_decode if response is string
* renamed some variables to camelCase
* removed ApiClient and Configuration classes
* added HeaderSelector template
* added ObjectSerializer injection
* regenerated all samples
* added AuthConfig and readded support for custom api keys
* readded support for oauth tokens
* readded basic auth; moved auth tests to separate test class
* readded header params
* readded support for collections in paths
* readded config option; readded exception handling
* file downloading; readded some Configuration properties removed earlier
* readded default headers
* made responses and return types work same way as earlier
* made all methods static in ObjectSerializer
* updated test.php, replaced autoload.php with composer's autoloader
* updated api doc template
* removed classes used for testing; regenerated Fake_classname_tags123Api
* replaced httplug with guzzle6
* updated required php version to 5.5
* clean up
* readded missing userAgent feature; removed default headers from Configuration
* updated test.php
* downgraded phpunit back to 4.8 to work with php5.5; fixed client initialization in some tests
2017-04-03 15:47:57 +08:00
baartosz
d21e156071
[PHP] error when deserializing enums #4032 ( #4886 )
...
* fixed enum template; added enum handling to ObjectSerializer
* regenerated templates
* improved InvalidArgumentException message
* regenerated sample client
* added value check of OuterEnum during sanitization
* regenerated samples
2017-03-08 19:08:42 +08:00
Pete Holiday
2e4de0ca1e
Remove unnecessary call to setHost() in the constructor ( #4525 )
...
* Remove unnecessary call to setHost() in the constructor
The default host will be automatically set on the client by the ApiClient constructor.
* Updated PHP API Classes corresponding to template updates in #4525 .
* Additional changes generated by the petstore update unrelated to #4525 , but seem to have not been included yet.
* Add test to prevent regressions of #4525
2017-01-12 16:17:17 +08:00
Arne Jørgensen
f5f4adac29
[PHP] Handle empty array response correct
2016-06-13 23:22:04 +02:00
Arne Jørgensen
d3fe0ae28a
[PHP] Improve codestyle of phpunit tests
2016-05-14 13:45:41 +02:00
Arne Jørgensen
f5a802d9af
[PHP] Fix default values in derived classes
...
Fixes flaw in 9f40a82310b36764e5d8ee055983c888ac4d88a6.
2016-05-06 23:48:52 +02:00
wing328
ac2cb647b5
Merge branch 'php-fix-array-handling' of https://github.com/arnested/swagger-codegen into arnested-php-fix-array-handling
...
Conflicts:
modules/swagger-codegen/src/main/resources/php/model.mustache
samples/client/petstore/php/SwaggerClient-php/README.md
samples/client/petstore/php/SwaggerClient-php/docs/FormatTest.md
samples/client/petstore/php/SwaggerClient-php/lib/Api/FakeApi.php
samples/client/petstore/php/SwaggerClient-php/lib/Model/Animal.php
samples/client/petstore/php/SwaggerClient-php/lib/Model/ApiResponse.php
samples/client/petstore/php/SwaggerClient-php/lib/Model/Cat.php
samples/client/petstore/php/SwaggerClient-php/lib/Model/Category.php
samples/client/petstore/php/SwaggerClient-php/lib/Model/Dog.php
samples/client/petstore/php/SwaggerClient-php/lib/Model/FormatTest.php
samples/client/petstore/php/SwaggerClient-php/lib/Model/Model200Response.php
samples/client/petstore/php/SwaggerClient-php/lib/Model/ModelReturn.php
samples/client/petstore/php/SwaggerClient-php/lib/Model/Name.php
samples/client/petstore/php/SwaggerClient-php/lib/Model/Order.php
samples/client/petstore/php/SwaggerClient-php/lib/Model/Pet.php
samples/client/petstore/php/SwaggerClient-php/lib/Model/SpecialModelName.php
samples/client/petstore/php/SwaggerClient-php/lib/Model/Tag.php
samples/client/petstore/php/SwaggerClient-php/lib/Model/User.php
2016-05-06 10:46:36 +08:00
wing328
a7ca0ad11f
add enum number support to php
2016-05-03 11:16:05 +08:00
Arne Jørgensen
7f99469efd
[PHP] Add test case testing ArrayAccess interface
...
Test if we implement the ArrayAccess interface correct on out model objects.
2016-04-27 21:00:58 +02:00
Arne Jørgensen
dcccfa4b99
Fix class name in test cases
2016-04-18 22:10:35 +02:00
wing328
d19ed8a89b
fix php test cases with petstore test yaml
2016-04-14 16:19:38 +08:00
Arne Jørgensen
65d677c385
Set discriminator property in constructor
...
When using inheritance let the constructor set the discriminator
property to the model name.
This avoids redundant and error prone stuff like:
```
$animal = new \Swagger\Client\Model\Dog();
$animal->setClassName('Dog');
```
2016-04-09 21:05:18 +02:00
Arne Jørgensen
0196cdd558
[PHP] Use parent constructor when inheriting
2016-03-28 11:30:27 +02:00
wing328
95cd8b73a6
update sample code, update test case
2016-03-19 16:03:36 +08:00
wing328
b5c0f17a02
update php to handle object type and add more test case
2016-03-05 14:25:01 +08:00
Elijah Miller
6698c532e6
Keep PHP binary responses as strings for easier manipulation.
2016-03-03 11:01:13 -05:00
wing328
4e034d3dc5
better reserved word handling for php
2016-02-25 13:16:54 +08:00
wing328
fd9a62adbe
update php test case with higher memory limit
2016-02-18 16:40:13 +08:00
wing328
751b4cd832
remove var_dump
2016-01-20 21:46:10 +08:00
wing328
058b408dfb
add test cases for findPetsByTags
2016-01-20 21:42:51 +08:00
wing328
dcd2c00fe6
fix empty object serialization issue
2016-01-18 21:42:24 +08:00
wing328
9fd4f39c8c
update tostring to use sanitizeforserialization
2016-01-18 21:27:29 +08:00
wing328
fee8acef97
fix isBinary, CodegenParameter copy, add isBinary to php api client
2016-01-15 11:43:02 +08:00
wing328
c7b9635e98
add test cases for byte array (body)
2016-01-15 11:43:02 +08:00
wing328
f54185c66d
add binary support for php response
2016-01-15 11:43:02 +08:00
wing328
cba7e063e1
add test case for objectserializer
2016-01-11 21:01:02 +08:00
wing328
eebf743fad
better filename handling in objectseralizer (php)
2016-01-11 16:16:49 +08:00
wing328
64427a16d1
add more test case for php (array of array, map of map)
2016-01-08 10:34:19 +08:00
wing328
11466570f7
php add test case for withinfo method returnig void
2015-12-07 00:30:17 +08:00
wing328
b282d4fbea
add http_parse_headers, update test case
2015-12-06 23:58:25 +08:00
wing328
ddc4d8460d
fix php access token setter
2015-11-25 00:00:26 +08:00
wing328
f2df26f6e6
fix deserializing datetime, add test case
2015-08-22 23:09:12 +08:00
wing328
71a22141bf
add enum support for model property
2015-07-13 15:24:11 +08:00
wing328
38149173ff
revert petstore json, fixed test case
2015-07-13 15:21:39 +08:00
wing328
7f31da734d
add file response for php, update test case
2015-07-13 15:09:09 +08:00
Tony Tam
07d5365c5c
merged from #902 , rebuilt client
2015-06-25 10:17:28 -07:00