From c96ba5e82a83c34af394b489f49d962e6293cc75 Mon Sep 17 00:00:00 2001 From: Jonny Barnes Date: Sun, 17 Mar 2019 14:06:18 +0000 Subject: [PATCH] Fixing tests Most were a case of adding void return statement to setUp and tearDown, also needed to add 6th `null` param to indieauth method. Its for code_verifier, issue created to work out what I should actually be doing with that. --- app/Http/Controllers/TokenEndpointController.php | 3 ++- tests/Feature/Admin/ContactsTest.php | 2 +- tests/Feature/ParseCachedWebMentionsTest.php | 4 ++-- tests/Unit/Jobs/DownloadWebMentionJobTest.php | 2 +- tests/Unit/Jobs/ProcessWebMentionJobTest.php | 2 +- tests/Unit/Jobs/SaveProfileImageJobTest.php | 2 +- 6 files changed, 8 insertions(+), 7 deletions(-) diff --git a/app/Http/Controllers/TokenEndpointController.php b/app/Http/Controllers/TokenEndpointController.php index f065c3f2..9a2aab06 100644 --- a/app/Http/Controllers/TokenEndpointController.php +++ b/app/Http/Controllers/TokenEndpointController.php @@ -48,7 +48,8 @@ class TokenEndpointController extends Controller request()->input('code'), request()->input('me'), request()->input('redirect_uri'), - request()->input('client_id') + request()->input('client_id'), + null // code_verifier ); if (array_key_exists('me', $auth)) { $scope = $auth['scope'] ?? ''; diff --git a/tests/Feature/Admin/ContactsTest.php b/tests/Feature/Admin/ContactsTest.php index 2921bc26..7c13ab12 100644 --- a/tests/Feature/Admin/ContactsTest.php +++ b/tests/Feature/Admin/ContactsTest.php @@ -15,7 +15,7 @@ class ContactsTest extends TestCase { use DatabaseTransactions; - public function tearDown() + protected function tearDown(): void { if (file_exists(public_path() . '/assets/profile-images/tantek.com/image')) { unlink(public_path() . '/assets/profile-images/tantek.com/image'); diff --git a/tests/Feature/ParseCachedWebMentionsTest.php b/tests/Feature/ParseCachedWebMentionsTest.php index 5cedfb43..f07bf247 100644 --- a/tests/Feature/ParseCachedWebMentionsTest.php +++ b/tests/Feature/ParseCachedWebMentionsTest.php @@ -12,7 +12,7 @@ class ParseCachedWebMentionsTest extends TestCase { use DatabaseTransactions; - public function setUp() + protected function setUp(): void { parent::setUp(); @@ -43,7 +43,7 @@ class ParseCachedWebMentionsTest extends TestCase $this->assertTrue($webmentionTantek->updated_at->gt($webmentionTantek->created_at)); } - public function tearDown() + protected function tearDown(): void { $fs = new FileSystem(); if ($fs->exists(storage_path() . '/HTML/https')) { diff --git a/tests/Unit/Jobs/DownloadWebMentionJobTest.php b/tests/Unit/Jobs/DownloadWebMentionJobTest.php index 39dade3c..bc8731d4 100644 --- a/tests/Unit/Jobs/DownloadWebMentionJobTest.php +++ b/tests/Unit/Jobs/DownloadWebMentionJobTest.php @@ -13,7 +13,7 @@ use Illuminate\Foundation\Testing\RefreshDatabase; class DownloadWebMentionJobTest extends TestCase { - public function tearDown() + protected function tearDown(): void { $fs = new FileSystem(); if ($fs->exists(storage_path() . '/HTML/https')) { diff --git a/tests/Unit/Jobs/ProcessWebMentionJobTest.php b/tests/Unit/Jobs/ProcessWebMentionJobTest.php index 6a845caf..045e7df4 100644 --- a/tests/Unit/Jobs/ProcessWebMentionJobTest.php +++ b/tests/Unit/Jobs/ProcessWebMentionJobTest.php @@ -20,7 +20,7 @@ class ProcessWebMentionJobTest extends TestCase { use DatabaseTransactions; - public function tearDown() + protected function tearDown(): void { $fs = new FileSystem(); if ($fs->exists(storage_path() . '/HTML/https')) { diff --git a/tests/Unit/Jobs/SaveProfileImageJobTest.php b/tests/Unit/Jobs/SaveProfileImageJobTest.php index da4ddf74..e278798b 100644 --- a/tests/Unit/Jobs/SaveProfileImageJobTest.php +++ b/tests/Unit/Jobs/SaveProfileImageJobTest.php @@ -14,7 +14,7 @@ use Jonnybarnes\WebmentionsParser\Exceptions\AuthorshipParserException; class SaveProfileImageJobTest extends TestCase { - public function tearDown() + protected function tearDown(): void { if (file_exists(public_path() . '/assets/profile-images/example.org/image')) { unlink(public_path() . '/assets/profile-images/example.org/image');