From 6f1d834a8e46781333600169b80f67da745490bc Mon Sep 17 00:00:00 2001 From: Micheal Mand Date: Tue, 20 Apr 2021 15:09:06 -0600 Subject: [PATCH 1/5] PHP 8 Support --- CHANGELOG.md | 6 ++++++ composer.json | 2 +- phpunit.xml | 4 ++-- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d24e1f4..098d741 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,3 +20,9 @@ Updates should follow the [Keep a CHANGELOG](http://keepachangelog.com/) princip ### Security - Nothing + + +## [] Unreleased + +### Added +- Support for PHP 8 diff --git a/composer.json b/composer.json index cf7c2fb..28fc136 100755 --- a/composer.json +++ b/composer.json @@ -14,7 +14,7 @@ } ], "require": { - "php": "^7.2", + "php": "^7.2|^8.0", "league/flysystem": "~1.0", "gliterd/backblaze-b2": ">=1.5.0", "psr/http-message-implementation": "*", diff --git a/phpunit.xml b/phpunit.xml index 2131e26..0ab5239 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,7 +1,7 @@ - \ No newline at end of file + From d2cd194d44a4fda233f38bc544de5cf7a39af32c Mon Sep 17 00:00:00 2001 From: Micheal Mand Date: Sat, 24 Apr 2021 16:00:43 -0600 Subject: [PATCH 2/5] Upgrade PHPUnit to v9 --- .gitignore | 3 ++- .travis.yml | 5 ++++- composer.json | 2 +- phpunit.hhvm.xml | 17 +++++++++-------- phpunit.php | 3 --- phpunit.xml | 21 +++++++++++---------- tests/BackblazeAdapterTests.php | 11 ++++++----- 7 files changed, 33 insertions(+), 29 deletions(-) delete mode 100644 phpunit.php diff --git a/.gitignore b/.gitignore index 1c894ce..ba32375 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,5 @@ docs vendor coverage coverage.xml -.idea \ No newline at end of file +.idea +.phpunit.result.cache \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 919e55a..ec62acf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,7 +2,10 @@ language: php php: - hhvm - - '7.1' + - '7.2' + - '7.3' + - '7.4' + - '8.0' - nightly install: diff --git a/composer.json b/composer.json index 28fc136..0297b4f 100755 --- a/composer.json +++ b/composer.json @@ -21,7 +21,7 @@ "mikey179/vfsstream": "*" }, "require-dev": { - "phpunit/phpunit" : "~4.0||~5.0", + "phpunit/phpunit" : "^9.0", "scrutinizer/ocular": "~1.1", "squizlabs/php_codesniffer": "~2.3" }, diff --git a/phpunit.hhvm.xml b/phpunit.hhvm.xml index 5df38f6..169ad0a 100644 --- a/phpunit.hhvm.xml +++ b/phpunit.hhvm.xml @@ -1,14 +1,15 @@ - @@ -16,9 +17,9 @@ ./tests/ - - + + ./src/ - - - \ No newline at end of file + + + diff --git a/phpunit.php b/phpunit.php deleted file mode 100644 index a0bb447..0000000 --- a/phpunit.php +++ /dev/null @@ -1,3 +0,0 @@ - - @@ -16,14 +17,14 @@ ./tests/ - - + + ./src/ - - + + - - - + + + diff --git a/tests/BackblazeAdapterTests.php b/tests/BackblazeAdapterTests.php index 65906bb..ae6516c 100644 --- a/tests/BackblazeAdapterTests.php +++ b/tests/BackblazeAdapterTests.php @@ -3,8 +3,9 @@ use BackblazeB2\File; use League\Flysystem\Config; use Mhetreramesh\Flysystem\BackblazeAdapter as Backblaze; +use PHPUnit\Framework\TestCase; -class BackblazeAdapterTests extends PHPUnit_Framework_TestCase +class BackblazeAdapterTests extends TestCase { /** * @var vfsStreamDirectory @@ -49,7 +50,7 @@ public function testWrite($adapter, $mock) { $mock->upload(['BucketId' => null, 'BucketName' => 'my_bucket', 'FileName' => 'something', 'Body' => 'contents'])->willReturn(new File('something', '', '', '', ''), false); $result = $adapter->write('something', 'contents', new Config()); - $this->assertInternalType('array', $result); + $this->assertIsArray($result); $this->assertArrayHasKey('type', $result); $this->assertEquals('file', $result['type']); } @@ -61,7 +62,7 @@ public function testWriteStream($adapter, $mock) { $mock->upload(['BucketId' => null, 'BucketName' => 'my_bucket', 'FileName' => 'something', 'Body' => 'contents'])->willReturn(new File('something', '', '', '', ''), false); $result = $adapter->writeStream('something', 'contents', new Config()); - $this->assertInternalType('array', $result); + $this->assertIsArray($result); $this->assertArrayHasKey('type', $result); $this->assertEquals('file', $result['type']); } @@ -73,7 +74,7 @@ public function testUpdate($adapter, $mock) { $mock->upload(['BucketId' => null, 'BucketName' => 'my_bucket', 'FileName' => 'something', 'Body' => 'contents'])->willReturn(new File('something', '', '', '', ''), false); $result = $adapter->update('something', 'contents', new Config()); - $this->assertInternalType('array', $result); + $this->assertIsArray($result); $this->assertArrayHasKey('type', $result); $this->assertEquals('file', $result['type']); } @@ -85,7 +86,7 @@ public function testUpdateStream($adapter, $mock) { $mock->upload(['BucketId' => null, 'BucketName' => 'my_bucket', 'FileName' => 'something', 'Body' => 'contents'])->willReturn(new File('something', '', '', '', ''), false); $result = $adapter->updateStream('something', 'contents', new Config()); - $this->assertInternalType('array', $result); + $this->assertIsArray($result); $this->assertArrayHasKey('type', $result); $this->assertEquals('file', $result['type']); } From d8b173bd3aa6de778c5fa43d9a3141da2e2a89dd Mon Sep 17 00:00:00 2001 From: Micheal Mand Date: Sat, 24 Apr 2021 16:22:39 -0600 Subject: [PATCH 3/5] Tell Scrutinizer and Travis not to test on PHP 7.2 PHP 7.2 is EOL --- .scrutinizer.yml | 2 +- .travis.yml | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.scrutinizer.yml b/.scrutinizer.yml index 375acc3..d786826 100644 --- a/.scrutinizer.yml +++ b/.scrutinizer.yml @@ -30,4 +30,4 @@ tools: build: environment: php: - version: 7.2 \ No newline at end of file + version: 7.3 \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index ec62acf..50501dd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,7 +2,6 @@ language: php php: - hhvm - - '7.2' - '7.3' - '7.4' - '8.0' From 04aa5edd0a32e7310a96e8e66883ad5d0f474f25 Mon Sep 17 00:00:00 2001 From: Micheal Mand Date: Sat, 24 Apr 2021 16:32:34 -0600 Subject: [PATCH 4/5] Fix phpcs errors in CI Signed-off-by: Micheal Mand --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 0297b4f..0079e0b 100755 --- a/composer.json +++ b/composer.json @@ -23,7 +23,7 @@ "require-dev": { "phpunit/phpunit" : "^9.0", "scrutinizer/ocular": "~1.1", - "squizlabs/php_codesniffer": "~2.3" + "squizlabs/php_codesniffer": "^3.6" }, "autoload": { "psr-4": { From 6cc8d79f008416ab1c022147c8f185b6de658ec5 Mon Sep 17 00:00:00 2001 From: Remmelt Pit Date: Thu, 3 Jun 2021 14:33:11 +0200 Subject: [PATCH 5/5] Correct version for scrutinizer --- .scrutinizer.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.scrutinizer.yml b/.scrutinizer.yml index d786826..62f2818 100644 --- a/.scrutinizer.yml +++ b/.scrutinizer.yml @@ -30,4 +30,4 @@ tools: build: environment: php: - version: 7.3 \ No newline at end of file + version: 8.0