From 8262bdab03cb7af5cab6a82c80181147fd1fc097 Mon Sep 17 00:00:00 2001 From: Tom Welch Date: Tue, 1 Dec 2020 18:41:10 +0000 Subject: [PATCH 1/4] Fix tests for PHPUnit 8 --- tests/NotificationSlackChannelTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/NotificationSlackChannelTest.php b/tests/NotificationSlackChannelTest.php index ce8f71b..d609d94 100644 --- a/tests/NotificationSlackChannelTest.php +++ b/tests/NotificationSlackChannelTest.php @@ -22,7 +22,7 @@ class NotificationSlackChannelTest extends TestCase */ private $guzzleHttp; - protected function setUp() + protected function setUp(): void { parent::setUp(); @@ -31,7 +31,7 @@ protected function setUp() $this->slackChannel = new SlackWebhookChannel($this->guzzleHttp); } - public function tearDown() + public function tearDown(): void { m::close(); } From 052e178411d5fff735175de93f8bcee68be083a3 Mon Sep 17 00:00:00 2001 From: Tom Welch Date: Tue, 1 Dec 2020 18:41:19 +0000 Subject: [PATCH 2/4] Fix tests for Guzzle 7 --- tests/NotificationSlackChannelTest.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/NotificationSlackChannelTest.php b/tests/NotificationSlackChannelTest.php index d609d94..1a78387 100644 --- a/tests/NotificationSlackChannelTest.php +++ b/tests/NotificationSlackChannelTest.php @@ -4,6 +4,7 @@ use Mockery as m; use GuzzleHttp\Client; +use GuzzleHttp\Psr7\Response; use PHPUnit\Framework\TestCase; use Illuminate\Notifications\Notifiable; use Illuminate\Notifications\Notification; @@ -46,6 +47,8 @@ public function testCorrectPayloadIsSentToSlack(Notification $notification, arra $this->guzzleHttp->shouldReceive('post')->andReturnUsing(function ($argUrl, $argPayload) use ($payload) { $this->assertEquals('url', $argUrl); $this->assertEquals($payload, $argPayload); + + return new Response(); }); $this->slackChannel->send(new NotificationSlackChannelTestNotifiable, $notification); From 609e57c33c0cc89f3fe115198533b4b966f7ba1a Mon Sep 17 00:00:00 2001 From: Tom Welch Date: Tue, 1 Dec 2020 18:41:45 +0000 Subject: [PATCH 3/4] gitignore phpunit.result.cache --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 0ae7f26..ee9bd74 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ composer.phar composer.lock .DS_Store Thumbs.db +.phpunit.result.cache From 7414b7c23b4b95013b40e9ea9faf4d6fe9128cd3 Mon Sep 17 00:00:00 2001 From: Tom Welch Date: Tue, 1 Dec 2020 18:41:55 +0000 Subject: [PATCH 4/4] Add PHP8 support --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 977fad9..9ccc3b3 100644 --- a/composer.json +++ b/composer.json @@ -10,7 +10,7 @@ } ], "require": { - "php": "^7.1.3", + "php": "^7.1.3|^8.0", "guzzlehttp/guzzle": "^6.0|^7.0", "laravel/slack-notification-channel": "^2.0" },