mirror of
				https://github.com/kevinveenbirkenbach/infinito.git
				synced 2025-11-03 18:58:01 +00:00 
			
		
		
		
	Refactored code through substituting by PureSource
This commit is contained in:
		@@ -5,10 +5,10 @@ namespace Tests\Integration\Domain\SourceManagement;
 | 
			
		||||
use PHPUnit\Framework\TestCase;
 | 
			
		||||
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;
 | 
			
		||||
use App\Domain\SourceManagement\SourceMembershipInformation;
 | 
			
		||||
use App\Entity\Source\PureSource;
 | 
			
		||||
 | 
			
		||||
class SourceMemberManagerIntegrationTest extends TestCase
 | 
			
		||||
{
 | 
			
		||||
@@ -22,21 +22,15 @@ class SourceMemberManagerIntegrationTest extends TestCase
 | 
			
		||||
     */
 | 
			
		||||
    private $sourceMemberManager;
 | 
			
		||||
 | 
			
		||||
    private function createSource(): SourceInterface
 | 
			
		||||
    {
 | 
			
		||||
        return new class() extends AbstractSource {
 | 
			
		||||
        };
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function setUp(): void
 | 
			
		||||
    {
 | 
			
		||||
        $this->source = $this->createSource();
 | 
			
		||||
        $this->source = new PureSource();
 | 
			
		||||
        $this->sourceMemberManager = new SourceMemberManager($this->source);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function testSourceMemberInformationIntegration(): void
 | 
			
		||||
    {
 | 
			
		||||
        $childSource = $this->createSource();
 | 
			
		||||
        $childSource = new PureSource();
 | 
			
		||||
        $sourceMemberInformation = new SourceMemberInformation($this->source);
 | 
			
		||||
        $this->sourceMemberManager->addMember($childSource);
 | 
			
		||||
        $this->assertEquals($childSource, $sourceMemberInformation->getAllMembers()->get(0));
 | 
			
		||||
@@ -46,7 +40,7 @@ class SourceMemberManagerIntegrationTest extends TestCase
 | 
			
		||||
 | 
			
		||||
    public function testSourceMembershipInformationIntegration(): void
 | 
			
		||||
    {
 | 
			
		||||
        $parentSource = $this->createSource();
 | 
			
		||||
        $parentSource = new PureSource();
 | 
			
		||||
        $sourceMemberInformation = new SourceMembershipInformation($this->source);
 | 
			
		||||
        $this->sourceMemberManager->addMembership($parentSource);
 | 
			
		||||
        $this->assertEquals($parentSource, $sourceMemberInformation->getAllMemberships()->get(0));
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user