From a6a0e5b3d469d369f493038f22cf091b72ca37bb Mon Sep 17 00:00:00 2001 From: arp Date: Tue, 27 Feb 2018 15:57:01 +0100 Subject: [PATCH 1/2] updated phpUnit to version 7 --- .travis.yml | 2 +- composer.json | 2 +- tests/AbstractMiddlewareTest.php | 2 +- tests/OriginFetchers/HostHeaderTest.php | 3 ++- tests/SafeRequests/CompositeIsSafeTest.php | 2 +- tests/SafeRequests/IsBypassedCheckTest.php | 2 +- tests/SafeRequests/IsSafeHttpMethodTest.php | 2 +- tests/SafeRequests/IsSafeHttpRouteTest.php | 2 +- 8 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index 027d908..d4711d8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ language: php php: -- 7.0 - 7.1 +- 7.2 cache: directories: - $HOME/.composer/cache diff --git a/composer.json b/composer.json index 27db89f..2b927da 100644 --- a/composer.json +++ b/composer.json @@ -12,7 +12,7 @@ "http-interop/http-middleware": "^0.4" }, "require-dev": { - "phpunit/phpunit": "^5.7.14", + "phpunit/phpunit": "^7.0.2", "satooshi/php-coveralls": "^1.0", "zendframework/zend-diactoros": "^1.4" }, diff --git a/tests/AbstractMiddlewareTest.php b/tests/AbstractMiddlewareTest.php index f2f7c60..8e1b0c2 100644 --- a/tests/AbstractMiddlewareTest.php +++ b/tests/AbstractMiddlewareTest.php @@ -8,7 +8,7 @@ use Psr\Http\Message\ServerRequestInterface; use Zend\Diactoros\Response\TextResponse; -abstract class AbstractMiddlewareTest extends \PHPUnit_Framework_TestCase +abstract class AbstractMiddlewareTest extends TestCase { protected function getDelegate() : DelegateInterface { diff --git a/tests/OriginFetchers/HostHeaderTest.php b/tests/OriginFetchers/HostHeaderTest.php index 990b9df..9811b0a 100644 --- a/tests/OriginFetchers/HostHeaderTest.php +++ b/tests/OriginFetchers/HostHeaderTest.php @@ -2,10 +2,11 @@ namespace TheCodingMachine\Middlewares\OriginFetchers; +use PHPUnit\Framework\TestCase; use TheCodingMachine\Middlewares\CsrfHeaderCheckMiddlewareException; use Zend\Diactoros\ServerRequest; -class HostHeaderTest extends \PHPUnit_Framework_TestCase +class HostHeaderTest extends TestCase { public function testFetchHost() { diff --git a/tests/SafeRequests/CompositeIsSafeTest.php b/tests/SafeRequests/CompositeIsSafeTest.php index 2f6bbda..6a30426 100644 --- a/tests/SafeRequests/CompositeIsSafeTest.php +++ b/tests/SafeRequests/CompositeIsSafeTest.php @@ -5,7 +5,7 @@ use PHPUnit\Framework\TestCase; use Psr\Http\Message\ServerRequestInterface; -class CompositeIsSafeTest extends \PHPUnit_Framework_TestCase +class CompositeIsSafeTest extends TestCase { private function getChecker(bool $result): IsSafeHttpRequestInterface { diff --git a/tests/SafeRequests/IsBypassedCheckTest.php b/tests/SafeRequests/IsBypassedCheckTest.php index 57ca2fd..2f93f67 100644 --- a/tests/SafeRequests/IsBypassedCheckTest.php +++ b/tests/SafeRequests/IsBypassedCheckTest.php @@ -5,7 +5,7 @@ use PHPUnit\Framework\TestCase; use Zend\Diactoros\ServerRequest; -class IsBypassedCheckTest extends \PHPUnit_Framework_TestCase +class IsBypassedCheckTest extends TestCase { public function testBypassCheck() { diff --git a/tests/SafeRequests/IsSafeHttpMethodTest.php b/tests/SafeRequests/IsSafeHttpMethodTest.php index 67c2d82..efb26b7 100644 --- a/tests/SafeRequests/IsSafeHttpMethodTest.php +++ b/tests/SafeRequests/IsSafeHttpMethodTest.php @@ -10,7 +10,7 @@ /** * @covers \TheCodingMachine\Middlewares\SafeRequests\IsSafeHttpMethod */ -final class IsSafeHttpMethodTest extends \PHPUnit_Framework_TestCase +final class IsSafeHttpMethodTest extends TestCase { /** * @dataProvider httpMethodsProvider diff --git a/tests/SafeRequests/IsSafeHttpRouteTest.php b/tests/SafeRequests/IsSafeHttpRouteTest.php index e743902..fd6f394 100644 --- a/tests/SafeRequests/IsSafeHttpRouteTest.php +++ b/tests/SafeRequests/IsSafeHttpRouteTest.php @@ -11,7 +11,7 @@ /** * @covers \TheCodingMachine\Middlewares\SafeRequests\IsSafeHttpRoute */ -final class IsSafeHttpRouteTest extends \PHPUnit_Framework_TestCase +final class IsSafeHttpRouteTest extends TestCase { /** * @dataProvider routesProvider From b818239d4d09b369f23df57eb53aa70d2ef7e5cd Mon Sep 17 00:00:00 2001 From: arp Date: Tue, 27 Feb 2018 16:17:47 +0100 Subject: [PATCH 2/2] replaced humbug by infection --- .gitignore | 3 +-- .travis.yml | 7 +++++-- humbug.json.dist | 12 ------------ infection.json.dist | 11 +++++++++++ 4 files changed, 17 insertions(+), 16 deletions(-) delete mode 100644 humbug.json.dist create mode 100644 infection.json.dist diff --git a/.gitignore b/.gitignore index c327f5c..8deb862 100644 --- a/.gitignore +++ b/.gitignore @@ -3,5 +3,4 @@ /build/ /phpunit.xml .php_cs.cache -/humbug/ -/humbug-log* +/infection-log.txt diff --git a/.travis.yml b/.travis.yml index d4711d8..2fd192e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,9 +11,12 @@ env: - PREFER_LOWEST="" before_script: - composer update --prefer-dist $PREFER_LOWEST -- git clone https://github.com/padraic/humbug.git && cd humbug && composer install && cd .. +- wget https://github.com/infection/infection/releases/download/0.7.1/infection.phar +- wget https://github.com/infection/infection/releases/download/0.7.1/infection.phar.pubkey +- chmod +x infection.phar +- mkdir -p build/logs script: - "./vendor/bin/phpunit" -- ./humbug/bin/humbug +- ./infection.phar after_script: - if [ -z "$PREFER_LOWEST" ]; then ./vendor/bin/coveralls -v; fi diff --git a/humbug.json.dist b/humbug.json.dist deleted file mode 100644 index 41ca588..0000000 --- a/humbug.json.dist +++ /dev/null @@ -1,12 +0,0 @@ -{ - "timeout": 30, - "source": { - "directories": [ - "src" - ] - }, - "logs": { - "text": "humbug-log.txt", - "json": "humbug-log.json" - } -} diff --git a/infection.json.dist b/infection.json.dist new file mode 100644 index 0000000..d2348ea --- /dev/null +++ b/infection.json.dist @@ -0,0 +1,11 @@ +{ + "timeout": 30, + "source": { + "directories": [ + "src" + ] + }, + "logs": { + "text": "infection-log.txt" + } +} \ No newline at end of file