From 8e3befc1bd3c45424fc6f076295cae9e32c90364 Mon Sep 17 00:00:00 2001 From: philipp lang Date: Sat, 19 Feb 2022 18:08:29 +0100 Subject: [PATCH] Fixed member update --- app/Member/UpdateJob.php | 5 +++-- tests/Feature/Member/UpdateTest.php | 8 ++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/app/Member/UpdateJob.php b/app/Member/UpdateJob.php index 1cce0f79..3b6ece88 100644 --- a/app/Member/UpdateJob.php +++ b/app/Member/UpdateJob.php @@ -3,6 +3,7 @@ namespace App\Member; use App\Confession; +use App\Setting\NamiSettings; use App\User; use Illuminate\Bus\Queueable; use Illuminate\Contracts\Queue\ShouldQueue; @@ -28,7 +29,7 @@ class UpdateJob implements ShouldQueue * * @return void */ - public function handle() + public function handle(NamiSettings $settings) { $this->member = Member::find($this->memberId); @@ -36,7 +37,7 @@ class UpdateJob implements ShouldQueue return; } - $response = $this->service->login()->putMember([ + $response = $settings->login()->putMember([ 'firstname' => $this->member->firstname, 'lastname' => $this->member->lastname, 'joined_at' => $this->member->joined_at, diff --git a/tests/Feature/Member/UpdateTest.php b/tests/Feature/Member/UpdateTest.php index ce58889d..a529151b 100644 --- a/tests/Feature/Member/UpdateTest.php +++ b/tests/Feature/Member/UpdateTest.php @@ -24,7 +24,7 @@ class UpdateTest extends TestCase public function testItRedirectsToMemberOverview(): void { - $this->withoutExceptionHandling()->login(); + $this->withoutExceptionHandling()->login()->loginNami(); $member = $this->member(); $this->fakeRequest(); @@ -37,7 +37,7 @@ class UpdateTest extends TestCase public function testItHasPutRequest(): void { - $this->withoutExceptionHandling()->login(); + $this->withoutExceptionHandling()->login()->loginNami(); $member = $this->member(); $this->fakeRequest(); @@ -52,7 +52,7 @@ class UpdateTest extends TestCase public function testItMergesExistingData(): void { - $this->withoutExceptionHandling()->login(); + $this->withoutExceptionHandling()->login()->loginNami(); $member = $this->member(); $this->fakeRequest(); @@ -69,7 +69,7 @@ class UpdateTest extends TestCase public function testItUpdatesVersion(): void { - $this->withoutExceptionHandling()->login(); + $this->withoutExceptionHandling()->login()->loginNami(); $member = $this->member(); $this->fakeRequest();