Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Slim] Migration to PHP7 #1263

Merged
merged 4 commits into from
Oct 26, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
## Requirements

* Web server with URL rewriting
* PHP 5.5.9 or newer
* PHP 7.0 or newer

This package contains `.htaccess` for Apache configuration.
If you use another server(Nginx, HHVM, IIS, lighttpd) check out [Web Servers](https://www.slimframework.com/docs/v3/start/web-servers.html) doc.
Expand All @@ -30,9 +30,9 @@ $ php -S localhost:8888 -t php-slim-server

## Run tests

This package uses PHPUnit 4.8 for unit testing and PHP Codesniffer to check source code against user defined coding standard(`phpcsStandard` generator config option).
This package uses PHPUnit 6 or 7(depends from your PHP version) for unit testing and PHP Codesniffer to check source code against user defined coding standard(`phpcsStandard` generator config option).
[Test folder]({{testBasePath}}) contains templates which you can fill with real test assertions.
How to write tests read at [PHPUnit Manual - Chapter 2. Writing Tests for PHPUnit](https://phpunit.de/manual/4.8/en/writing-tests-for-phpunit.html).
How to write tests read at [PHPUnit Manual - Chapter 2. Writing Tests for PHPUnit](https://phpunit.de/manual/6.5/en/writing-tests-for-phpunit.html).
How to configure PHP CodeSniffer read at [PHP CodeSniffer Documentation](https://github.com/squizlabs/PHP_CodeSniffer/wiki).
There is [phplint](https://github.com/overtrue/phplint) tool to check php syntax automatically.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
*/
namespace {{apiPackage}};

use PHPUnit\Framework\TestCase;
use {{apiPackage}}\{{classname}};

/**
Expand All @@ -45,7 +46,7 @@ use {{apiPackage}}\{{classname}};
* @link https://github.com/openapitools/openapi-generator
* @coversDefaultClass \{{modelPackage}}\{{classname}}
*/
{{#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
@@ -1,12 +1,12 @@
{
"minimum-stability": "RC",
"require": {
"php": ">=5.5.9",
"php": "^7.0",
"slim/slim": "3.*",
"tuupola/slim-basic-auth": "^3.0.0"
"tuupola/slim-basic-auth": "^2.0 || ^3.0"
},
"require-dev": {
"phpunit/phpunit": "^4.8",
"phpunit/phpunit": "^6.0 || ^7.0",
"overtrue/phplint": "^1.0",
"squizlabs/php_codesniffer": "^3.0"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
*/
namespace {{modelPackage}};

use PHPUnit\Framework\TestCase;
use {{modelPackage}}\{{classname}};

/**
Expand All @@ -47,7 +48,7 @@ use {{modelPackage}}\{{classname}};
* @link https://github.com/openapitools/openapi-generator
* @coversDefaultClass \{{modelPackage}}\{{classname}}
*/
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 @@ -7,7 +7,8 @@
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
stopOnFailure="false">
beStrictAboutTestsThatDoNotTestAnything="false"
stopOnFailure="false"
>
<testsuites>
<testsuite name="Apis">
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.3.0-SNAPSHOT
3.3.2-SNAPSHOT
6 changes: 3 additions & 3 deletions samples/server/petstore-security-test/php-slim/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
## Requirements

* Web server with URL rewriting
* PHP 5.5.9 or newer
* PHP 7.0 or newer

This package contains `.htaccess` for Apache configuration.
If you use another server(Nginx, HHVM, IIS, lighttpd) check out [Web Servers](https://www.slimframework.com/docs/v3/start/web-servers.html) doc.
Expand All @@ -30,9 +30,9 @@ $ php -S localhost:8888 -t php-slim-server

## Run tests

This package uses PHPUnit 4.8 for unit testing and PHP Codesniffer to check source code against user defined coding standard(`phpcsStandard` generator config option).
This package uses PHPUnit 6 or 7(depends from your PHP version) for unit testing and PHP Codesniffer to check source code against user defined coding standard(`phpcsStandard` generator config option).
[Test folder](test) contains templates which you can fill with real test assertions.
How to write tests read at [PHPUnit Manual - Chapter 2. Writing Tests for PHPUnit](https://phpunit.de/manual/4.8/en/writing-tests-for-phpunit.html).
How to write tests read at [PHPUnit Manual - Chapter 2. Writing Tests for PHPUnit](https://phpunit.de/manual/6.5/en/writing-tests-for-phpunit.html).
How to configure PHP CodeSniffer read at [PHP CodeSniffer Documentation](https://github.com/squizlabs/PHP_CodeSniffer/wiki).
There is [phplint](https://github.com/overtrue/phplint) tool to check php syntax automatically.

Expand Down
6 changes: 3 additions & 3 deletions samples/server/petstore-security-test/php-slim/composer.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"minimum-stability": "RC",
"require": {
"php": ">=5.5.9",
"php": "^7.0",
"slim/slim": "3.*",
"tuupola/slim-basic-auth": "^3.0.0"
"tuupola/slim-basic-auth": "^2.0 || ^3.0"
},
"require-dev": {
"phpunit/phpunit": "^4.8",
"phpunit/phpunit": "^6.0 || ^7.0",
"overtrue/phplint": "^1.0",
"squizlabs/php_codesniffer": "^3.0"
},
Expand Down
Loading