From 78551d01807518a5e809955eaa92f3ac7115c440 Mon Sep 17 00:00:00 2001 From: Nathan Broadbent Date: Sat, 6 Jul 2019 21:21:41 +0700 Subject: [PATCH] Set error_reporting(E_ALL) in phpunit.xml settings, to crash on undefined variables (#3266) * Set error_reporting(E_ALL) in phpunit.xml settings, so that undefined variables will always cause a test failure * Update petstore sample for php-laravel --- .../main/resources/php-laravel/phpunit.xml | 1 + .../src/main/resources/php-lumen/phpunit.xml | 1 + .../php-slim-server/phpunit.xml.mustache | 5 ++- .../php-symfony/testing/phpunit.xml.mustache | 9 +++-- .../main/resources/php/phpunit.xml.mustache | 4 ++- .../php/OpenAPIClient-php/phpunit.xml.dist | 4 ++- .../php/OpenAPIClient-php/phpunit.xml.dist | 4 ++- .../php-laravel/.openapi-generator/VERSION | 2 +- .../Controllers/AnotherFakeController.php | 2 +- .../FakeClassnameTags123Controller.php | 2 +- .../app/Http/Controllers/FakeController.php | 2 +- .../app/Http/Controllers/PetController.php | 2 +- .../app/Http/Controllers/StoreController.php | 2 +- .../app/Http/Controllers/UserController.php | 2 +- .../Models/AdditionalPropertiesAnyType.php | 15 ++++++++ .../app/Models/AdditionalPropertiesArray.php | 15 ++++++++ .../Models/AdditionalPropertiesBoolean.php | 15 ++++++++ .../app/Models/AdditionalPropertiesClass.php | 35 ++++++++++++++++--- .../Models/AdditionalPropertiesInteger.php | 15 ++++++++ .../app/Models/AdditionalPropertiesNumber.php | 15 ++++++++ .../app/Models/AdditionalPropertiesObject.php | 15 ++++++++ .../app/Models/AdditionalPropertiesString.php | 15 ++++++++ .../php-laravel/lib/app/Models/CatAllOf.php | 15 ++++++++ .../php-laravel/lib/app/Models/DogAllOf.php | 15 ++++++++ .../petstore/php-laravel/lib/phpunit.xml | 1 + .../petstore/php-laravel/lib/routes/api.php | 2 +- .../php-laravel/lib/routes/channels.php | 2 +- .../php-laravel/lib/routes/console.php | 2 +- .../petstore/php-laravel/lib/routes/web.php | 2 +- .../server/petstore/php-slim/phpunit.xml.dist | 5 ++- .../SymfonyBundle-php/phpunit.xml.dist | 9 +++-- 31 files changed, 205 insertions(+), 30 deletions(-) create mode 100644 samples/server/petstore/php-laravel/lib/app/Models/AdditionalPropertiesAnyType.php create mode 100644 samples/server/petstore/php-laravel/lib/app/Models/AdditionalPropertiesArray.php create mode 100644 samples/server/petstore/php-laravel/lib/app/Models/AdditionalPropertiesBoolean.php create mode 100644 samples/server/petstore/php-laravel/lib/app/Models/AdditionalPropertiesInteger.php create mode 100644 samples/server/petstore/php-laravel/lib/app/Models/AdditionalPropertiesNumber.php create mode 100644 samples/server/petstore/php-laravel/lib/app/Models/AdditionalPropertiesObject.php create mode 100644 samples/server/petstore/php-laravel/lib/app/Models/AdditionalPropertiesString.php create mode 100644 samples/server/petstore/php-laravel/lib/app/Models/CatAllOf.php create mode 100644 samples/server/petstore/php-laravel/lib/app/Models/DogAllOf.php diff --git a/modules/openapi-generator/src/main/resources/php-laravel/phpunit.xml b/modules/openapi-generator/src/main/resources/php-laravel/phpunit.xml index c9e326b695..1037dd6ad0 100644 --- a/modules/openapi-generator/src/main/resources/php-laravel/phpunit.xml +++ b/modules/openapi-generator/src/main/resources/php-laravel/phpunit.xml @@ -23,6 +23,7 @@ + diff --git a/modules/openapi-generator/src/main/resources/php-lumen/phpunit.xml b/modules/openapi-generator/src/main/resources/php-lumen/phpunit.xml index c703297e25..218bbb4b49 100644 --- a/modules/openapi-generator/src/main/resources/php-lumen/phpunit.xml +++ b/modules/openapi-generator/src/main/resources/php-lumen/phpunit.xml @@ -20,6 +20,7 @@ + diff --git a/modules/openapi-generator/src/main/resources/php-slim-server/phpunit.xml.mustache b/modules/openapi-generator/src/main/resources/php-slim-server/phpunit.xml.mustache index dbddf2737d..b8852944a1 100644 --- a/modules/openapi-generator/src/main/resources/php-slim-server/phpunit.xml.mustache +++ b/modules/openapi-generator/src/main/resources/php-slim-server/phpunit.xml.mustache @@ -24,4 +24,7 @@ {{modelSrcPath}} - \ No newline at end of file + + + + diff --git a/modules/openapi-generator/src/main/resources/php-symfony/testing/phpunit.xml.mustache b/modules/openapi-generator/src/main/resources/php-symfony/testing/phpunit.xml.mustache index bd5b2978ee..8a6ff770c4 100644 --- a/modules/openapi-generator/src/main/resources/php-symfony/testing/phpunit.xml.mustache +++ b/modules/openapi-generator/src/main/resources/php-symfony/testing/phpunit.xml.mustache @@ -11,15 +11,14 @@ {{modelTestPath}} - - - - - {{apiSrcPath}} {{modelSrcPath}} + + + + diff --git a/modules/openapi-generator/src/main/resources/php/phpunit.xml.mustache b/modules/openapi-generator/src/main/resources/php/phpunit.xml.mustache index 089480f6b1..66b2c40c98 100644 --- a/modules/openapi-generator/src/main/resources/php/phpunit.xml.mustache +++ b/modules/openapi-generator/src/main/resources/php/phpunit.xml.mustache @@ -11,11 +11,13 @@ {{modelTestPath}} - {{apiSrcPath}} {{modelSrcPath}} + + + diff --git a/samples/client/petstore/php/OpenAPIClient-php/phpunit.xml.dist b/samples/client/petstore/php/OpenAPIClient-php/phpunit.xml.dist index 08f78faf3b..3dd90bbe32 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/phpunit.xml.dist +++ b/samples/client/petstore/php/OpenAPIClient-php/phpunit.xml.dist @@ -11,11 +11,13 @@ ./test/Model - ./lib/Api ./lib/Model + + + diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/phpunit.xml.dist b/samples/openapi3/client/petstore/php/OpenAPIClient-php/phpunit.xml.dist index 08f78faf3b..3dd90bbe32 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/phpunit.xml.dist +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/phpunit.xml.dist @@ -11,11 +11,13 @@ ./test/Model - ./lib/Api ./lib/Model + + + diff --git a/samples/server/petstore/php-laravel/.openapi-generator/VERSION b/samples/server/petstore/php-laravel/.openapi-generator/VERSION index afa6365606..479c313e87 100644 --- a/samples/server/petstore/php-laravel/.openapi-generator/VERSION +++ b/samples/server/petstore/php-laravel/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.0-SNAPSHOT \ No newline at end of file +4.0.3-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/php-laravel/lib/app/Http/Controllers/AnotherFakeController.php b/samples/server/petstore/php-laravel/lib/app/Http/Controllers/AnotherFakeController.php index 0bfed630f7..700d13d11e 100644 --- a/samples/server/petstore/php-laravel/lib/app/Http/Controllers/AnotherFakeController.php +++ b/samples/server/petstore/php-laravel/lib/app/Http/Controllers/AnotherFakeController.php @@ -4,7 +4,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI-Generator diff --git a/samples/server/petstore/php-laravel/lib/app/Http/Controllers/FakeClassnameTags123Controller.php b/samples/server/petstore/php-laravel/lib/app/Http/Controllers/FakeClassnameTags123Controller.php index 94e368ae8d..46ccd6e5fd 100644 --- a/samples/server/petstore/php-laravel/lib/app/Http/Controllers/FakeClassnameTags123Controller.php +++ b/samples/server/petstore/php-laravel/lib/app/Http/Controllers/FakeClassnameTags123Controller.php @@ -4,7 +4,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI-Generator diff --git a/samples/server/petstore/php-laravel/lib/app/Http/Controllers/FakeController.php b/samples/server/petstore/php-laravel/lib/app/Http/Controllers/FakeController.php index 8a1bea9c46..eddab9354c 100644 --- a/samples/server/petstore/php-laravel/lib/app/Http/Controllers/FakeController.php +++ b/samples/server/petstore/php-laravel/lib/app/Http/Controllers/FakeController.php @@ -4,7 +4,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI-Generator diff --git a/samples/server/petstore/php-laravel/lib/app/Http/Controllers/PetController.php b/samples/server/petstore/php-laravel/lib/app/Http/Controllers/PetController.php index dd7201b615..5fc490b27c 100644 --- a/samples/server/petstore/php-laravel/lib/app/Http/Controllers/PetController.php +++ b/samples/server/petstore/php-laravel/lib/app/Http/Controllers/PetController.php @@ -4,7 +4,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI-Generator diff --git a/samples/server/petstore/php-laravel/lib/app/Http/Controllers/StoreController.php b/samples/server/petstore/php-laravel/lib/app/Http/Controllers/StoreController.php index 867c802f84..6c7013f5b6 100644 --- a/samples/server/petstore/php-laravel/lib/app/Http/Controllers/StoreController.php +++ b/samples/server/petstore/php-laravel/lib/app/Http/Controllers/StoreController.php @@ -4,7 +4,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI-Generator diff --git a/samples/server/petstore/php-laravel/lib/app/Http/Controllers/UserController.php b/samples/server/petstore/php-laravel/lib/app/Http/Controllers/UserController.php index e516e4792a..365502a3be 100644 --- a/samples/server/petstore/php-laravel/lib/app/Http/Controllers/UserController.php +++ b/samples/server/petstore/php-laravel/lib/app/Http/Controllers/UserController.php @@ -4,7 +4,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI-Generator diff --git a/samples/server/petstore/php-laravel/lib/app/Models/AdditionalPropertiesAnyType.php b/samples/server/petstore/php-laravel/lib/app/Models/AdditionalPropertiesAnyType.php new file mode 100644 index 0000000000..6cd496f72a --- /dev/null +++ b/samples/server/petstore/php-laravel/lib/app/Models/AdditionalPropertiesAnyType.php @@ -0,0 +1,15 @@ + + diff --git a/samples/server/petstore/php-laravel/lib/routes/api.php b/samples/server/petstore/php-laravel/lib/routes/api.php index 5d597c2228..1cf047e59d 100644 --- a/samples/server/petstore/php-laravel/lib/routes/api.php +++ b/samples/server/petstore/php-laravel/lib/routes/api.php @@ -4,7 +4,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI-Generator diff --git a/samples/server/petstore/php-laravel/lib/routes/channels.php b/samples/server/petstore/php-laravel/lib/routes/channels.php index a221d1f5e0..ce848a9a1b 100644 --- a/samples/server/petstore/php-laravel/lib/routes/channels.php +++ b/samples/server/petstore/php-laravel/lib/routes/channels.php @@ -4,7 +4,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI-Generator diff --git a/samples/server/petstore/php-laravel/lib/routes/console.php b/samples/server/petstore/php-laravel/lib/routes/console.php index 7604b2c9b9..0ed63f6741 100644 --- a/samples/server/petstore/php-laravel/lib/routes/console.php +++ b/samples/server/petstore/php-laravel/lib/routes/console.php @@ -4,7 +4,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI-Generator diff --git a/samples/server/petstore/php-laravel/lib/routes/web.php b/samples/server/petstore/php-laravel/lib/routes/web.php index 8b045358df..325aca0792 100644 --- a/samples/server/petstore/php-laravel/lib/routes/web.php +++ b/samples/server/petstore/php-laravel/lib/routes/web.php @@ -4,7 +4,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI-Generator diff --git a/samples/server/petstore/php-slim/phpunit.xml.dist b/samples/server/petstore/php-slim/phpunit.xml.dist index 5804ff4945..6af1442ee6 100644 --- a/samples/server/petstore/php-slim/phpunit.xml.dist +++ b/samples/server/petstore/php-slim/phpunit.xml.dist @@ -24,4 +24,7 @@ ./lib/Model - \ No newline at end of file + + + + diff --git a/samples/server/petstore/php-symfony/SymfonyBundle-php/phpunit.xml.dist b/samples/server/petstore/php-symfony/SymfonyBundle-php/phpunit.xml.dist index ec07d2081c..6f8b5ca0f9 100644 --- a/samples/server/petstore/php-symfony/SymfonyBundle-php/phpunit.xml.dist +++ b/samples/server/petstore/php-symfony/SymfonyBundle-php/phpunit.xml.dist @@ -11,15 +11,14 @@ ./Tests/Model - - - - - ././Api ././Model + + + +