Optimized SourceMemberInformation

This commit is contained in:
Kevin Frantz
2018-12-30 16:12:46 +01:00
parent 713ddae0df
commit 3a6ed4d54d
4 changed files with 44 additions and 51 deletions

View File

@@ -7,6 +7,7 @@ use App\Entity\Source\SourceInterface;
use App\Domain\SourceManagement\SourceMemberManagerInterface;
use App\Entity\Source\AbstractSource;
use App\Domain\SourceManagement\SourceMemberManager;
use App\Domain\SourceManagement\SourceMemberInformation;
class SourceMemberManagerTest extends TestCase
{
@@ -53,4 +54,17 @@ class SourceMemberManagerTest extends TestCase
$this->assertEquals(0, $this->source->getMemberRelation()->getMemberships()->count());
$this->assertEquals(0, $membership->getMemberRelation()->getMembers()->count());
}
/**
* @todo Move this function to an own integration test class
*/
public function testSourceMemberInformationIntegration(): void
{
$childSource = $this->createSource();
$sourceMemberInformation = new SourceMemberInformation($this->source);
$this->sourceMemberManager->addMember($childSource);
$this->assertEquals($childSource, $sourceMemberInformation->getAllMembers()->get(0));
$this->sourceMemberManager->removeMember($childSource);
$this->assertEquals(0, $sourceMemberInformation->getAllMembers()->count());
}
}