From 61cc08dda0af8c951bad2c03f268fc5c20ca76fe Mon Sep 17 00:00:00 2001 From: Philipp Lang Date: Tue, 8 Nov 2022 16:02:12 +0100 Subject: [PATCH] Lint --- src/Fakes/MembershipFake.php | 6 ++++++ tests/Unit/PullMembershipTest.php | 19 +++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 tests/Unit/PullMembershipTest.php diff --git a/src/Fakes/MembershipFake.php b/src/Fakes/MembershipFake.php index e03d358..d8108b4 100644 --- a/src/Fakes/MembershipFake.php +++ b/src/Fakes/MembershipFake.php @@ -6,6 +6,9 @@ use Illuminate\Support\Facades\Http; class MembershipFake extends Fake { + /** + * @param array $membershipIds + */ public function fetches(int $memberId, array $membershipIds): self { Http::fake(function ($request) use ($memberId, $membershipIds) { @@ -54,6 +57,9 @@ class MembershipFake extends Fake return $this; } + /** + * @param array{id: int, gruppierung?: string, taetigkeit?: string, taetigkeitId?: int, untergliederung?: string, untergliederungId?: int, aktivVon?: string, aktivBis?: string} $data + */ public function shows(int $memberId, array $data): self { Http::fake(function ($request) use ($memberId, $data) { diff --git a/tests/Unit/PullMembershipTest.php b/tests/Unit/PullMembershipTest.php new file mode 100644 index 0000000..1a1d266 --- /dev/null +++ b/tests/Unit/PullMembershipTest.php @@ -0,0 +1,19 @@ +fetches(105, [['id' => 56, 'entries_taetigkeit' => 'Leiter']]); + + $memberships = $this->login()->membershipsOf(105); + + $this->assertEquals('Leiter', $memberships->first()->activity); + } +}