From 99974ec425182292170278fd69c876b443b427da Mon Sep 17 00:00:00 2001 From: philipp lang Date: Sun, 6 Mar 2022 02:50:00 +0100 Subject: [PATCH] Add group name to membership --- src/Data/Membership.php | 3 +++ tests/Unit/Api/MembershipTest.php | 2 ++ 2 files changed, 5 insertions(+) diff --git a/src/Data/Membership.php b/src/Data/Membership.php index ce33dfd..89beb14 100644 --- a/src/Data/Membership.php +++ b/src/Data/Membership.php @@ -30,6 +30,9 @@ class Membership extends DataTransferObject { #[MapFrom('untergliederungId')] public int $subactivityId; + #[MapFrom('gruppierung')] + public ?string $group; + public function toNami(): array { return [ diff --git a/tests/Unit/Api/MembershipTest.php b/tests/Unit/Api/MembershipTest.php index 090b148..bd74795 100644 --- a/tests/Unit/Api/MembershipTest.php +++ b/tests/Unit/Api/MembershipTest.php @@ -23,6 +23,7 @@ class MembershipTest extends TestCase 'gruppierungId' => 1000, 'taetigkeitId' => 15, 'untergliederungId' => 16, + 'gruppierung' => '::group::', ]); $membership = $this->login()->membership(6, 10); @@ -34,6 +35,7 @@ class MembershipTest extends TestCase $this->assertSame(1000, $membership->groupId); $this->assertSame(15, $membership->activityId); $this->assertSame(16, $membership->subactivityId); + $this->assertSame('::group::', $membership->group); } public function testFetchesMembership(): void