Left hints

This commit is contained in:
Kevin Frantz 2018-12-30 15:01:22 +01:00
parent f77b5ae9a4
commit 713ddae0df
2 changed files with 13 additions and 0 deletions

View File

@ -42,6 +42,8 @@ final class SourceMemberInformation implements SourceMemberInformationInterface
/** /**
* @todo Implement tests! * @todo Implement tests!
* *
* @deprecated The input data should be correct!
*
* @param EntityInterface $member * @param EntityInterface $member
*/ */
private function addMemberSource(EntityInterface $member): void private function addMemberSource(EntityInterface $member): void
@ -56,6 +58,8 @@ final class SourceMemberInformation implements SourceMemberInformationInterface
/** /**
* @todo Implement tests * @todo Implement tests
* *
* @deprecated The input data should be correct!
*
* @param EntityInterface $member * @param EntityInterface $member
* *
* @return Collection * @return Collection

View File

@ -123,14 +123,23 @@ class LawPermissionCheckerTest extends TestCase
$parentSource->setSlug('Parent Source'); $parentSource->setSlug('Parent Source');
$parentSourceMemberManager = new SourceMemberManager($parentSource); $parentSourceMemberManager = new SourceMemberManager($parentSource);
$parentSourceMemberManager->addMember($this->clientSource); $parentSourceMemberManager->addMember($this->clientSource);
/*
* The following asserts just check if the SourceMemberManager works like expected
*/
$this->assertEquals($parentSource, $this->clientSource->getMemberRelation()->getMemberships()->get(0)->getSource()); $this->assertEquals($parentSource, $this->clientSource->getMemberRelation()->getMemberships()->get(0)->getSource());
$this->assertEquals($this->clientSource, $parentSource->getMemberRelation()->getMembers()->get(0)->getSource()); $this->assertEquals($this->clientSource, $parentSource->getMemberRelation()->getMembers()->get(0)->getSource());
$parentSourceRight = $this->getClonedClientRight(); $parentSourceRight = $this->getClonedClientRight();
$parentSourceRight->setReciever($parentSource); $parentSourceRight->setReciever($parentSource);
$this->law->getRights()->add($parentSourceRight); $this->law->getRights()->add($parentSourceRight);
/*
* The following asserts just check if the in the tet defined values are like expected
*/
$this->assertEquals($parentSourceRight, $this->law->getRights()->get(0)); $this->assertEquals($parentSourceRight, $this->law->getRights()->get(0));
$this->assertEquals($parentSource, $parentSourceRight->getReciever()); $this->assertEquals($parentSource, $parentSourceRight->getReciever());
$this->assertEquals($this->source, $parentSourceRight->getSource()); $this->assertEquals($this->source, $parentSourceRight->getSource());
/*
* The following asserts are the important asserts for the test
*/
$this->assertTrue($this->checkClientPermission()); $this->assertTrue($this->checkClientPermission());
$this->law->setRights(new ArrayCollection()); $this->law->setRights(new ArrayCollection());
$this->assertFalse($this->checkClientPermission()); $this->assertFalse($this->checkClientPermission());