mirror of
				https://github.com/kevinveenbirkenbach/infinito.git
				synced 2025-11-04 11:17:58 +00:00 
			
		
		
		
	Implemented LayerRepositoryFactoryAttribut
This commit is contained in:
		@@ -0,0 +1,34 @@
 | 
			
		||||
<?php
 | 
			
		||||
 | 
			
		||||
namespace App\Attribut;
 | 
			
		||||
 | 
			
		||||
use App\Domain\RepositoryManagement\LayerRepositoryFactoryServiceInterface;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @author kevinfrantz
 | 
			
		||||
 *
 | 
			
		||||
 * @see LayerRepositoryFactoryServiceAttributInterface
 | 
			
		||||
 */
 | 
			
		||||
trait LayerRepositoryFactoryServiceAttribut
 | 
			
		||||
{
 | 
			
		||||
    /**
 | 
			
		||||
     * @var LayerRepositoryFactoryServiceInterface
 | 
			
		||||
     */
 | 
			
		||||
    protected $layerRepositoryFactoryService;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * @param LayerRepositoryFactoryServiceInterface $layerRepositoryFactoryService
 | 
			
		||||
     */
 | 
			
		||||
    public function setLayerRepositoryFactoryService(LayerRepositoryFactoryServiceInterface $layerRepositoryFactoryService): void
 | 
			
		||||
    {
 | 
			
		||||
        $this->layerRepositoryFactoryService = $layerRepositoryFactoryService;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * @return LayerRepositoryFactoryServiceInterface
 | 
			
		||||
     */
 | 
			
		||||
    public function getLayerRepositoryFactoryService(): LayerRepositoryFactoryServiceInterface
 | 
			
		||||
    {
 | 
			
		||||
        return $this->layerRepositoryFactoryService;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -0,0 +1,21 @@
 | 
			
		||||
<?php
 | 
			
		||||
 | 
			
		||||
namespace App\Attribut;
 | 
			
		||||
 | 
			
		||||
use App\Domain\RepositoryManagement\LayerRepositoryFactoryServiceInterface;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @author kevinfrantz
 | 
			
		||||
 */
 | 
			
		||||
interface LayerRepositoryFactoryServiceAttributInterface
 | 
			
		||||
{
 | 
			
		||||
    /**
 | 
			
		||||
     * @param LayerRepositoryFactoryServiceInterface $layerRepositoryFactoryService
 | 
			
		||||
     */
 | 
			
		||||
    public function setLayerRepositoryFactoryService(LayerRepositoryFactoryServiceInterface $layerRepositoryFactoryService): void;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * @return LayerRepositoryFactoryServiceInterface
 | 
			
		||||
     */
 | 
			
		||||
    public function getLayerRepositoryFactoryService(): LayerRepositoryFactoryServiceInterface;
 | 
			
		||||
}
 | 
			
		||||
@@ -0,0 +1,39 @@
 | 
			
		||||
<?php
 | 
			
		||||
 | 
			
		||||
namespace Tests\Unit\Attribut;
 | 
			
		||||
 | 
			
		||||
use PHPUnit\Framework\TestCase;
 | 
			
		||||
use App\Attribut\LayerRepositoryFactoryServiceAttributInterface;
 | 
			
		||||
use App\Attribut\LayerRepositoryFactoryServiceAttribut;
 | 
			
		||||
use App\Domain\RepositoryManagement\LayerRepositoryFactoryServiceInterface;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @author kevinfrantz
 | 
			
		||||
 */
 | 
			
		||||
class RequestAttributTest extends TestCase
 | 
			
		||||
{
 | 
			
		||||
    /**
 | 
			
		||||
     * @var LayerRepositoryFactoryServiceAttributInterface
 | 
			
		||||
     */
 | 
			
		||||
    protected $layerRepositoryFactoryServiceAttribut;
 | 
			
		||||
 | 
			
		||||
    public function setUp(): void
 | 
			
		||||
    {
 | 
			
		||||
        $this->layerRepositoryFactoryServiceAttribut = new class() implements LayerRepositoryFactoryServiceAttributInterface {
 | 
			
		||||
            use LayerRepositoryFactoryServiceAttribut;
 | 
			
		||||
        };
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function testConstruct(): void
 | 
			
		||||
    {
 | 
			
		||||
        $this->expectException(\TypeError::class);
 | 
			
		||||
        $this->layerRepositoryFactoryServiceAttribut->getLayerRepositoryFactoryService();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function testAccessors(): void
 | 
			
		||||
    {
 | 
			
		||||
        $layerRepositoryFactoryService = $this->createMock(LayerRepositoryFactoryServiceInterface::class);
 | 
			
		||||
        $this->assertNull($this->layerRepositoryFactoryServiceAttribut->setLayerRepositoryFactoryService($layerRepositoryFactoryService));
 | 
			
		||||
        $this->assertEquals($layerRepositoryFactoryService, $this->layerRepositoryFactoryServiceAttribut->getLayerRepositoryFactoryService());
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user