52 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
eebf743fad better filename handling in objectseralizer (php) 2016-01-11 16:16:49 +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
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
Branden Cash
b74050dd7b Change to use the autoload.php and change the namespacing 2015-06-18 11:45:08 -07:00
William Cheng
436db1f8e7 add __toString and update php sample 2015-06-17 19:00:29 +08:00
wing328
a0c55693dc add test case for loginUser, separate test cases into different files 2015-06-10 21:59:48 +08:00
wing328
9aca2868b9 change static method to instance method, update test case to remove php warning 2015-06-10 21:18:48 +08:00
wing328
d0f9345c5a fix php map, add test case for get inventory 2015-06-05 21:57:12 +08:00
wing328
e993d08563 rename APIClient to ApiClient, APIClientException to APIException 2015-05-28 15:06:31 +08:00
wing328
171bf969c7 add debug switch to configuration 2015-05-26 23:20:34 +08:00
Tony Tam
156afa7795 Merge pull request #778 from wing328/php_apiclient_instance
[PHP] Make API client more pluggable
2015-05-23 08:54:33 -07:00
wing328
691838c47d add test case for api client instance 2015-05-23 10:35:19 +08:00
William Cheng
fa15f58506 fix warning/error in php5.3 2015-05-22 05:15:46 +08:00
Tony Tam
c8a56add5d merged 2015-05-20 22:45:52 -07:00
wing328
6e13403a37 fix http basic auth, add test cases for new api client without host 2015-05-20 21:55:16 +08:00
wing328
9a1dedbe76 add test case (getPetbyId), remove old authenetication (only supports header) 2015-05-20 18:43:34 +08:00
wing328
20439e646f add test case and prefix support 2015-05-20 18:25:35 +08:00
wing328
af260cba41 update api client to support default header 2015-05-19 15:33:03 +08:00
wing328
5aad44e628 added back test case for updatePetWithForm 2015-05-19 10:15:36 +08:00
wing328
41e178e268 better accept and content-type for php, added test cases 2015-05-18 22:16:54 +08:00
wing328
4466b6e15e add test case for upload file, improve error handling 2015-05-15 11:08:33 +08:00
wing328
7e37f3294a bug fix for post (model) and update php test cases 2015-04-17 20:01:58 +08:00