diff --git a/application/src/Domain/SourceManagement/SourceMembershipInformation.php b/application/src/Domain/SourceManagement/SourceMembershipInformation.php index a04240c..df233f6 100644 --- a/application/src/Domain/SourceManagement/SourceMembershipInformation.php +++ b/application/src/Domain/SourceManagement/SourceMembershipInformation.php @@ -28,7 +28,7 @@ class SourceMembershipInformation implements SourceMembershipInformationInterfac foreach ($memberships as $membership) { if (!$this->memberships->contains($membership)) { $this->memberships->add($membership); - $this->itterateOverMemberships($membership->getMemberships()); + $this->itterateOverMemberships($membership->getMemberRelation()->getMemberships()); } } } @@ -36,7 +36,7 @@ class SourceMembershipInformation implements SourceMembershipInformationInterfac public function getAllMemberships(): Collection { $this->memberships = new ArrayCollection(); - $this->itterateOverMemberships($this->source->getMemberships()); + $this->itterateOverMemberships($this->source->getMemberRelation()->getMemberships()); return $this->memberships; } diff --git a/application/tests/Unit/Domain/SourceManagement/SourceMembershipInformationTest.php b/application/tests/Unit/Domain/SourceManagement/SourceMembershipInformationTest.php index de64d56..73e0250 100644 --- a/application/tests/Unit/Domain/SourceManagement/SourceMembershipInformationTest.php +++ b/application/tests/Unit/Domain/SourceManagement/SourceMembershipInformationTest.php @@ -32,7 +32,7 @@ class SourceMembershipInformationTest extends TestCase public function testOneDimension(): void { - $this->source->getMemberships()->add(new TextSource()); + $this->source->getMemberRelation()->getMemberships()->add(new TextSource()); $this->assertEquals(1, $this->sourceMembershipInformation->getAllMemberships()->count()); } @@ -40,18 +40,18 @@ class SourceMembershipInformationTest extends TestCase { $source1 = new TextSource(); $source2 = new FirstNameSource(); - $source2->setMemberships(new ArrayCollection([$source1])); + $source2->getMemberRelation()->setMemberships(new ArrayCollection([$source1])); $source3 = new FullPersonNameSource(); - $source3->getMemberships()->add($source2); - $this->source->getMemberships()->add($source3); + $source3->getMemberRelation()->getMemberships()->add($source2); + $this->source->getMemberRelation()->getMemberships()->add($source3); $this->assertEquals(3, $this->sourceMembershipInformation->getAllMemberships()->count()); } public function testRecursion(): void { $recursiveSource = new UserSource(); - $recursiveSource->getMemberships()->add($this->source); - $this->source->getMemberships()->add($recursiveSource); + $recursiveSource->getMemberRelation()->getMemberships()->add($this->source); + $this->source->getMemberRelation()->getMemberships()->add($recursiveSource); $this->assertEquals(2, $this->sourceMembershipInformation->getAllMemberships()->count()); } }