Skip to content

Commit

Permalink
Set error_reporting(E_ALL) in phpunit.xml settings, to crash on undef…
Browse files Browse the repository at this point in the history
…ined variables (OpenAPITools#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
  • Loading branch information
ndbroadbent authored and wing328 committed Jul 6, 2019
1 parent fa10103 commit 78551d0
Show file tree
Hide file tree
Showing 31 changed files with 205 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
</whitelist>
</filter>
<php>
<ini name="error_reporting" value="E_ALL" />
<env name="APP_ENV" value="testing"/>
<env name="BCRYPT_ROUNDS" value="4"/>
<env name="CACHE_DRIVER" value="array"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
</whitelist>
</filter>
<php>
<ini name="error_reporting" value="E_ALL" />
<env name="APP_ENV" value="testing"/>
<env name="CACHE_DRIVER" value="array"/>
<env name="QUEUE_DRIVER" value="sync"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,7 @@
<directory suffix=".php">{{modelSrcPath}}</directory>
</whitelist>
</filter>
</phpunit>
<php>
<ini name="error_reporting" value="E_ALL" />
</php>
</phpunit>
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,14 @@
<directory>{{modelTestPath}}</directory>
</testsuite>
</testsuites>

<php>
<server name="KERNEL_DIR" value="Tests/" />
</php>

<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">{{apiSrcPath}}</directory>
<directory suffix=".php">{{modelSrcPath}}</directory>
</whitelist>
</filter>
<php>
<ini name="error_reporting" value="E_ALL" />
<server name="KERNEL_DIR" value="Tests/" />
</php>
</phpunit>
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@
<directory>{{modelTestPath}}</directory>
</testsuite>
</testsuites>

<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">{{apiSrcPath}}</directory>
<directory suffix=".php">{{modelSrcPath}}</directory>
</whitelist>
</filter>
<php>
<ini name="error_reporting" value="E_ALL" />
</php>
</phpunit>
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@
<directory>./test/Model</directory>
</testsuite>
</testsuites>

<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">./lib/Api</directory>
<directory suffix=".php">./lib/Model</directory>
</whitelist>
</filter>
<php>
<ini name="error_reporting" value="E_ALL" />
</php>
</phpunit>
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@
<directory>./test/Model</directory>
</testsuite>
</testsuites>

<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">./lib/Api</directory>
<directory suffix=".php">./lib/Model</directory>
</whitelist>
</filter>
<php>
<ini name="error_reporting" value="E_ALL" />
</php>
</phpunit>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.0.0-SNAPSHOT
4.0.3-SNAPSHOT
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php
/**
* AdditionalPropertiesAnyType
*/
namespace app\Models;

/**
* AdditionalPropertiesAnyType
*/
class AdditionalPropertiesAnyType {

/** @var string $name */
private $name;

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php
/**
* AdditionalPropertiesArray
*/
namespace app\Models;

/**
* AdditionalPropertiesArray
*/
class AdditionalPropertiesArray {

/** @var string $name */
private $name;

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php
/**
* AdditionalPropertiesBoolean
*/
namespace app\Models;

/**
* AdditionalPropertiesBoolean
*/
class AdditionalPropertiesBoolean {

/** @var string $name */
private $name;

}
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,37 @@
*/
class AdditionalPropertiesClass {

/** @var map[string,string] $mapProperty */
private $mapProperty;
/** @var map[string,string] $mapString */
private $mapString;

/** @var map[string,map[string,string]] $mapOfMapProperty */
private $mapOfMapProperty;
/** @var map[string,float] $mapNumber */
private $mapNumber;

/** @var map[string,int] $mapInteger */
private $mapInteger;

/** @var map[string,bool] $mapBoolean */
private $mapBoolean;

/** @var map[string,int[]] $mapArrayInteger */
private $mapArrayInteger;

/** @var map[string,object[]] $mapArrayAnytype */
private $mapArrayAnytype;

/** @var map[string,map[string,string]] $mapMapString */
private $mapMapString;

/** @var map[string,map[string,object]] $mapMapAnytype */
private $mapMapAnytype;

/** @var object $anytype1 */
private $anytype1;

/** @var object $anytype2 */
private $anytype2;

/** @var object $anytype3 */
private $anytype3;

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php
/**
* AdditionalPropertiesInteger
*/
namespace app\Models;

/**
* AdditionalPropertiesInteger
*/
class AdditionalPropertiesInteger {

/** @var string $name */
private $name;

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php
/**
* AdditionalPropertiesNumber
*/
namespace app\Models;

/**
* AdditionalPropertiesNumber
*/
class AdditionalPropertiesNumber {

/** @var string $name */
private $name;

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php
/**
* AdditionalPropertiesObject
*/
namespace app\Models;

/**
* AdditionalPropertiesObject
*/
class AdditionalPropertiesObject {

/** @var string $name */
private $name;

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php
/**
* AdditionalPropertiesString
*/
namespace app\Models;

/**
* AdditionalPropertiesString
*/
class AdditionalPropertiesString {

/** @var string $name */
private $name;

}
15 changes: 15 additions & 0 deletions samples/server/petstore/php-laravel/lib/app/Models/CatAllOf.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php
/**
* CatAllOf
*/
namespace app\Models;

/**
* CatAllOf
*/
class CatAllOf {

/** @var bool $declawed */
private $declawed;

}
15 changes: 15 additions & 0 deletions samples/server/petstore/php-laravel/lib/app/Models/DogAllOf.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php
/**
* DogAllOf
*/
namespace app\Models;

/**
* DogAllOf
*/
class DogAllOf {

/** @var string $breed */
private $breed;

}
1 change: 1 addition & 0 deletions samples/server/petstore/php-laravel/lib/phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
</whitelist>
</filter>
<php>
<ini name="error_reporting" value="E_ALL" />
<env name="APP_ENV" value="testing"/>
<env name="BCRYPT_ROUNDS" value="4"/>
<env name="CACHE_DRIVER" value="array"/>
Expand Down
2 changes: 1 addition & 1 deletion samples/server/petstore/php-laravel/lib/routes/api.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion samples/server/petstore/php-laravel/lib/routes/console.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion samples/server/petstore/php-laravel/lib/routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion samples/server/petstore/php-slim/phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,7 @@
<directory suffix=".php">./lib/Model</directory>
</whitelist>
</filter>
</phpunit>
<php>
<ini name="error_reporting" value="E_ALL" />
</php>
</phpunit>
Loading

0 comments on commit 78551d0

Please sign in to comment.