From 58b0bdaaa35a9b7a18547196ea73d4075ad5752a Mon Sep 17 00:00:00 2001 From: Nyholm Date: Wed, 30 Sep 2020 17:16:56 +0200 Subject: [PATCH 1/5] Test with PHPUnit 9 --- .travis.yml | 3 ++- composer.json | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index a76ce9a..9f7c016 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,7 +7,8 @@ cache: - $HOME/.composer/cache/files php: - - 7.3 + - 7.2 + - 7.4 env: - SUITE="curl" PACKAGE="php-http/curl-client:dev-master zendframework/zend-diactoros" diff --git a/composer.json b/composer.json index bec4c4e..71d756a 100644 --- a/composer.json +++ b/composer.json @@ -16,7 +16,7 @@ ], "require": { "php": "^7.1", - "phpunit/phpunit": "^7.0 || ^8.0", + "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0", "php-http/message": "^1.0", "guzzlehttp/psr7": "^1.0", "th3n3rd/cartesian-product": "^0.3" From a6d40a6e8d136eebabc6087f39a63e194dc2cae3 Mon Sep 17 00:00:00 2001 From: Nyholm Date: Wed, 30 Sep 2020 17:23:22 +0200 Subject: [PATCH 2/5] Allow more versions --- composer.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index 71d756a..b95c2b5 100644 --- a/composer.json +++ b/composer.json @@ -15,10 +15,10 @@ } ], "require": { - "php": "^7.1", - "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0", - "php-http/message": "^1.0", - "guzzlehttp/psr7": "^1.0", + "php": ">=7.1", + "phpunit/phpunit": "^7.5.20 || ^8.5.8 || ^9.3.11", + "php-http/message": "^1.0 || ^2.0", + "guzzlehttp/psr7": "^1.7", "th3n3rd/cartesian-product": "^0.3" }, "suggest": { From 8588cea079c181040115d5598075493a7fc0decb Mon Sep 17 00:00:00 2001 From: Nyholm Date: Wed, 30 Sep 2020 17:24:50 +0200 Subject: [PATCH 3/5] Remove things not needed --- src/FeatureTestListener.php | 67 ------------------------------------- src/ResultPrinter.php | 21 ------------ 2 files changed, 88 deletions(-) delete mode 100644 src/FeatureTestListener.php delete mode 100644 src/ResultPrinter.php diff --git a/src/FeatureTestListener.php b/src/FeatureTestListener.php deleted file mode 100644 index cf9e507..0000000 --- a/src/FeatureTestListener.php +++ /dev/null @@ -1,67 +0,0 @@ -extractFeature($test); - - if (empty($feature)) { - $feature = $test->getName(); - } else { - $feature = $feature[0]; - } - - echo sprintf('%-40.s : ', $feature); - } - - protected function doEndTest($test, $time) - { - if (!$this->lastTestFailed) { - echo $this->formatWithColor('fg-green', 'Supported')."\n"; - } else { - echo $this->formatWithColor('fg-red', 'Not supported')."\n"; - } - - $this->lastTestFailed = false; - } - - private function extractFeature($test) - { - $class = get_class($test); - $method = $test->getName(false); - $reflection = new \ReflectionMethod($class, $method); - - return $this->parseDocBlock($reflection->getDocComment(), '@feature'); - } - - private function parseDocBlock($doc_block, $tag) - { - $matches = []; - - if (empty($doc_block)) { - return $matches; - } - - $regex = "/{$tag} (.*)(\\r\\n|\\r|\\n)/U"; - preg_match_all($regex, $doc_block, $matches); - - if (empty($matches[1])) { - return []; - } - - $matches = $matches[1]; - - foreach ($matches as $ix => $match) { - $matches[$ix] = trim($match); - } - - return $matches; - } -} diff --git a/src/ResultPrinter.php b/src/ResultPrinter.php deleted file mode 100644 index 497f43f..0000000 --- a/src/ResultPrinter.php +++ /dev/null @@ -1,21 +0,0 @@ -doStartTest($test); - } - - public function endTest(Test $test, float $time): void - { - return $this->doEndTest($test, $time); - } -} From b41856b05be075f1f65ad12942f94494559ac329 Mon Sep 17 00:00:00 2001 From: Nyholm Date: Wed, 30 Sep 2020 17:29:06 +0200 Subject: [PATCH 4/5] minor --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 9f7c016..60c364f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,7 +7,6 @@ cache: - $HOME/.composer/cache/files php: - - 7.2 - 7.4 env: @@ -15,6 +14,7 @@ env: - SUITE="Socket" PACKAGE="php-http/socket-client:dev-master php-http/client-common" - SUITE="Guzzle6" PACKAGE="php-http/guzzle6-adapter:dev-master" - SUITE="Guzzle" PACKAGE="guzzlehttp/guzzle:dev-master" + - SUITE="Guzzle" PACKAGE="guzzlehttp/guzzle:dev-master phpunit/phpunit:^8.5.8" - SUITE="React" PACKAGE="php-http/react-adapter:dev-master" - SUITE="Buzz" PACKAGE="php-http/buzz-adapter:dev-master" - SUITE="CakePHP" PACKAGE="php-http/cakephp-adapter:dev-master" From 23503ad307fa4808ddebb12007d99d5f10c5d12a Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Wed, 30 Sep 2020 20:08:20 +0200 Subject: [PATCH 5/5] Update composer.json --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index b95c2b5..de79ea9 100644 --- a/composer.json +++ b/composer.json @@ -15,7 +15,7 @@ } ], "require": { - "php": ">=7.1", + "php": "^7.1 || ^8.0", "phpunit/phpunit": "^7.5.20 || ^8.5.8 || ^9.3.11", "php-http/message": "^1.0 || ^2.0", "guzzlehttp/psr7": "^1.7",