Skip to content

Commit

Permalink
[PHP] Bump minimum required version to PHP7.1 (OpenAPITools#1491)
Browse files Browse the repository at this point in the history
* Bump minimum required version to PHP7.1

ref: http://php.net/supported-versions.php

* Bump phpunit

* Update [api|model]_test.mustache

* Update samples

bin/openapi3/php-petstore.sh

* Update namespace of PHPUnit ("tests" folder)

* `setExpectedException` is deleted in PHPUnit 7.4

* Update namespace of "Assert" class

* The attribute 'name' is required

* Add anotation to exclude the test from risky testcheck

* Update samples (samples/client/petstore/php)

* Apply updates to "test" in openapi2 folder (samples/client/petstore/php)

OpenAPITools@b3495ec
OpenAPITools@15e00ae
OpenAPITools@2fc6917
OpenAPITools@0d016c0

* Install php7.1

* Switch to php7

* Update samples (security)

bin/security/php-petstore.sh
  • Loading branch information
ackintosh authored Nov 26, 2018
1 parent e370bc8 commit b50ecf7
Show file tree
Hide file tree
Showing 145 changed files with 416 additions and 166 deletions.
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ before_install:
- sudo sh -c 'curl https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list > /etc/apt/sources.list.d/dart_stable.list'
- sudo apt-get update
- sudo apt-get install dart
# switch to php7
- phpenv global 7.1
- php -v
# install perl module
#- cpanm --local-lib=~/perl5 local::lib && eval $(perl -I ~/perl5/lib/perl5/ -Mlocal::lib)
#- cpanm Test::Exception Test::More Log::Any LWP::UserAgent JSON URI:Query Module::Runtime DateTime Module::Find Moose::Role
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ namespace {{invokerPackage}};
use \{{invokerPackage}}\Configuration;
use \{{invokerPackage}}\ApiException;
use \{{invokerPackage}}\ObjectSerializer;
use PHPUnit\Framework\TestCase;

/**
* {{classname}}Test Class Doc Comment
Expand All @@ -30,7 +31,7 @@ use \{{invokerPackage}}\ObjectSerializer;
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
{{#operations}}class {{classname}}Test extends \PHPUnit_Framework_TestCase
{{#operations}}class {{classname}}Test extends TestCase
{
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@
}
],
"require": {
"php": ">=5.6",
"php": ">=7.1",
"ext-curl": "*",
"ext-json": "*",
"ext-mbstring": "*",
"guzzlehttp/guzzle": "^6.2"
},
"require-dev": {
"phpunit/phpunit": "^4.8",
"phpunit/phpunit": "^7.4",
"squizlabs/php_codesniffer": "~2.6",
"friendsofphp/php-cs-fixer": "~2.12"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@

namespace {{invokerPackage}};

use PHPUnit\Framework\TestCase;

/**
* {{classname}}Test Class Doc Comment
*
Expand All @@ -30,7 +32,7 @@ namespace {{invokerPackage}};
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
class {{classname}}Test extends \PHPUnit_Framework_TestCase
class {{classname}}Test extends TestCase
{
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
convertWarningsToExceptions="true"
stopOnFailure="false">
<testsuites>
<testsuite>
<testsuite name="tests">
<directory>{{apiTestPath}}</directory>
<directory>{{modelTestPath}}</directory>
</testsuite>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@
}
],
"require": {
"php": ">=5.6",
"php": ">=7.1",
"ext-curl": "*",
"ext-json": "*",
"ext-mbstring": "*",
"guzzlehttp/guzzle": "^6.2"
},
"require-dev": {
"phpunit/phpunit": "^4.8",
"phpunit/phpunit": "^7.4",
"squizlabs/php_codesniffer": "~2.6",
"friendsofphp/php-cs-fixer": "~2.12"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
convertWarningsToExceptions="true"
stopOnFailure="false">
<testsuites>
<testsuite>
<testsuite name="tests">
<directory>./test/Api</directory>
<directory>./test/Model</directory>
</testsuite>
Expand Down
4 changes: 2 additions & 2 deletions samples/client/petstore/php/OpenAPIClient-php/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@
}
],
"require": {
"php": ">=5.6",
"php": ">=7.1",
"ext-curl": "*",
"ext-json": "*",
"ext-mbstring": "*",
"guzzlehttp/guzzle": "^6.2"
},
"require-dev": {
"phpunit/phpunit": "^4.8",
"phpunit/phpunit": "^7.4",
"squizlabs/php_codesniffer": "~2.6",
"friendsofphp/php-cs-fixer": "~2.12"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
convertWarningsToExceptions="true"
stopOnFailure="false">
<testsuites>
<testsuite>
<testsuite name="tests">
<directory>./test/Api</directory>
<directory>./test/Model</directory>
</testsuite>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
use \OpenAPI\Client\Configuration;
use \OpenAPI\Client\ApiException;
use \OpenAPI\Client\ObjectSerializer;
use PHPUnit\Framework\TestCase;

/**
* AnotherFakeApiTest Class Doc Comment
Expand All @@ -40,7 +41,7 @@
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
class AnotherFakeApiTest extends \PHPUnit_Framework_TestCase
class AnotherFakeApiTest extends TestCase
{

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
use \OpenAPI\Client\Configuration;
use \OpenAPI\Client\ApiException;
use \OpenAPI\Client\ObjectSerializer;
use PHPUnit\Framework\TestCase;

/**
* FakeApiTest Class Doc Comment
Expand All @@ -40,7 +41,7 @@
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
class FakeApiTest extends \PHPUnit_Framework_TestCase
class FakeApiTest extends TestCase
{

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
use \OpenAPI\Client\Configuration;
use \OpenAPI\Client\ApiException;
use \OpenAPI\Client\ObjectSerializer;
use PHPUnit\Framework\TestCase;

/**
* FakeClassnameTags123ApiTest Class Doc Comment
Expand All @@ -40,7 +41,7 @@
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
class FakeClassnameTags123ApiTest extends \PHPUnit_Framework_TestCase
class FakeClassnameTags123ApiTest extends TestCase
{

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
use \OpenAPI\Client\Configuration;
use \OpenAPI\Client\ApiException;
use \OpenAPI\Client\ObjectSerializer;
use PHPUnit\Framework\TestCase;

/**
* PetApiTest Class Doc Comment
Expand All @@ -40,7 +41,7 @@
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
class PetApiTest extends \PHPUnit_Framework_TestCase
class PetApiTest extends TestCase
{

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
use \OpenAPI\Client\Configuration;
use \OpenAPI\Client\ApiException;
use \OpenAPI\Client\ObjectSerializer;
use PHPUnit\Framework\TestCase;

/**
* StoreApiTest Class Doc Comment
Expand All @@ -40,7 +41,7 @@
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
class StoreApiTest extends \PHPUnit_Framework_TestCase
class StoreApiTest extends TestCase
{

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
use \OpenAPI\Client\Configuration;
use \OpenAPI\Client\ApiException;
use \OpenAPI\Client\ObjectSerializer;
use PHPUnit\Framework\TestCase;

/**
* UserApiTest Class Doc Comment
Expand All @@ -40,7 +41,7 @@
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
class UserApiTest extends \PHPUnit_Framework_TestCase
class UserApiTest extends TestCase
{

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@

namespace OpenAPI\Client;

use PHPUnit\Framework\TestCase;

/**
* AdditionalPropertiesClassTest Class Doc Comment
*
Expand All @@ -38,7 +40,7 @@
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
class AdditionalPropertiesClassTest extends \PHPUnit_Framework_TestCase
class AdditionalPropertiesClassTest extends TestCase
{

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@

namespace OpenAPI\Client;

use PHPUnit\Framework\TestCase;

/**
* AnimalFarmTest Class Doc Comment
*
Expand All @@ -38,7 +40,7 @@
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
class AnimalFarmTest extends \PHPUnit_Framework_TestCase
class AnimalFarmTest extends TestCase
{

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@

namespace OpenAPI\Client;

use PHPUnit\Framework\TestCase;

/**
* AnimalTest Class Doc Comment
*
Expand All @@ -38,7 +40,7 @@
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
class AnimalTest extends \PHPUnit_Framework_TestCase
class AnimalTest extends TestCase
{

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@

namespace OpenAPI\Client;

use PHPUnit\Framework\TestCase;

/**
* ApiResponseTest Class Doc Comment
*
Expand All @@ -38,7 +40,7 @@
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
class ApiResponseTest extends \PHPUnit_Framework_TestCase
class ApiResponseTest extends TestCase
{

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@

namespace OpenAPI\Client;

use PHPUnit\Framework\TestCase;

/**
* ArrayOfArrayOfNumberOnlyTest Class Doc Comment
*
Expand All @@ -38,7 +40,7 @@
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
class ArrayOfArrayOfNumberOnlyTest extends \PHPUnit_Framework_TestCase
class ArrayOfArrayOfNumberOnlyTest extends TestCase
{

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@

namespace OpenAPI\Client;

use PHPUnit\Framework\TestCase;

/**
* ArrayOfNumberOnlyTest Class Doc Comment
*
Expand All @@ -38,7 +40,7 @@
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
class ArrayOfNumberOnlyTest extends \PHPUnit_Framework_TestCase
class ArrayOfNumberOnlyTest extends TestCase
{

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@

namespace OpenAPI\Client;

use PHPUnit\Framework\TestCase;

/**
* ArrayTestTest Class Doc Comment
*
Expand All @@ -38,7 +40,7 @@
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
class ArrayTestTest extends \PHPUnit_Framework_TestCase
class ArrayTestTest extends TestCase
{

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@

namespace OpenAPI\Client;

use PHPUnit\Framework\TestCase;

/**
* CapitalizationTest Class Doc Comment
*
Expand All @@ -38,7 +40,7 @@
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
class CapitalizationTest extends \PHPUnit_Framework_TestCase
class CapitalizationTest extends TestCase
{

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@

namespace OpenAPI\Client;

use PHPUnit\Framework\TestCase;

/**
* CatTest Class Doc Comment
*
Expand All @@ -38,7 +40,7 @@
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
class CatTest extends \PHPUnit_Framework_TestCase
class CatTest extends TestCase
{

/**
Expand Down
Loading

0 comments on commit b50ecf7

Please sign in to comment.