mirror of
				https://github.com/kevinveenbirkenbach/infinito.git
				synced 2025-11-04 11:17:58 +00:00 
			
		
		
		
	Refactored\moved Attribut folder
This commit is contained in:
		@@ -1,43 +0,0 @@
 | 
			
		||||
<?php
 | 
			
		||||
 | 
			
		||||
namespace Tests\Unit\Entity\Attribut;
 | 
			
		||||
 | 
			
		||||
use PHPUnit\Framework\TestCase;
 | 
			
		||||
use App\Exception\NoValidChoiceException;
 | 
			
		||||
use App\Entity\Attribut\ActionTypeAttributInterface;
 | 
			
		||||
use App\Entity\Attribut\ActionTypeAttribut;
 | 
			
		||||
use App\DBAL\Types\ActionType;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @author kevinfrantz
 | 
			
		||||
 */
 | 
			
		||||
class ActionTypeAttributTest extends TestCase
 | 
			
		||||
{
 | 
			
		||||
    /**
 | 
			
		||||
     * @var ActionTypeAttributInterface
 | 
			
		||||
     */
 | 
			
		||||
    protected $actionTypeAttribut;
 | 
			
		||||
 | 
			
		||||
    public function setUp(): void
 | 
			
		||||
    {
 | 
			
		||||
        $this->actionTypeAttribut = new class() implements ActionTypeAttributInterface {
 | 
			
		||||
            use ActionTypeAttribut;
 | 
			
		||||
        };
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function testConstructor(): void
 | 
			
		||||
    {
 | 
			
		||||
        $this->expectException(\TypeError::class);
 | 
			
		||||
        $this->actionTypeAttribut->getActionType();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function testAccessors(): void
 | 
			
		||||
    {
 | 
			
		||||
        foreach (ActionType::getChoices() as $enum) {
 | 
			
		||||
            $this->assertNull($this->actionTypeAttribut->setActionType($enum));
 | 
			
		||||
            $this->assertEquals($enum, $this->actionTypeAttribut->getActionType());
 | 
			
		||||
        }
 | 
			
		||||
        $this->expectException(NoValidChoiceException::class);
 | 
			
		||||
        $this->actionTypeAttribut->setActionType('NoneValidType');
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -1,36 +0,0 @@
 | 
			
		||||
<?php
 | 
			
		||||
 | 
			
		||||
namespace Entity\Attribut;
 | 
			
		||||
 | 
			
		||||
use PHPUnit\Framework\TestCase;
 | 
			
		||||
use App\Entity\Attribut\ChildsAttributeInterface;
 | 
			
		||||
use App\Entity\Attribut\ChildsAttribut;
 | 
			
		||||
use Doctrine\Common\Collections\ArrayCollection;
 | 
			
		||||
 | 
			
		||||
class ChildsAttributTest extends TestCase
 | 
			
		||||
{
 | 
			
		||||
    /**
 | 
			
		||||
     * @var ChildsAttributeInterface
 | 
			
		||||
     */
 | 
			
		||||
    protected $childs;
 | 
			
		||||
 | 
			
		||||
    public function setUp(): void
 | 
			
		||||
    {
 | 
			
		||||
        $this->childs = new class() implements ChildsAttributeInterface {
 | 
			
		||||
            use ChildsAttribut;
 | 
			
		||||
        };
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function testConstructor(): void
 | 
			
		||||
    {
 | 
			
		||||
        $this->expectException(\TypeError::class);
 | 
			
		||||
        $this->childs->getChilds();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function testAccessors(): void
 | 
			
		||||
    {
 | 
			
		||||
        $childs = new ArrayCollection();
 | 
			
		||||
        $this->assertNull($this->childs->setChilds($childs));
 | 
			
		||||
        $this->assertEquals($childs, $this->childs->getChilds());
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -1,45 +0,0 @@
 | 
			
		||||
<?php
 | 
			
		||||
 | 
			
		||||
namespace Tests\Unit\Entity\Attribut;
 | 
			
		||||
 | 
			
		||||
use PHPUnit\Framework\TestCase;
 | 
			
		||||
use App\Entity\Attribut\CollectionAttributInterface;
 | 
			
		||||
use App\Entity\Attribut\CollectionAttribut;
 | 
			
		||||
use Doctrine\Common\Collections\ArrayCollection;
 | 
			
		||||
 | 
			
		||||
class CollectionAttributTest extends TestCase
 | 
			
		||||
{
 | 
			
		||||
    /**
 | 
			
		||||
     * @var CollectionAttributInterface
 | 
			
		||||
     */
 | 
			
		||||
    protected $collection;
 | 
			
		||||
 | 
			
		||||
    public function setUp(): void
 | 
			
		||||
    {
 | 
			
		||||
        $this->collection = new class() implements CollectionAttributInterface {
 | 
			
		||||
            use CollectionAttribut;
 | 
			
		||||
        };
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function testConstructor(): void
 | 
			
		||||
    {
 | 
			
		||||
        $this->expectException(\TypeError::class);
 | 
			
		||||
        $this->collection->getCollection();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function testAccessors(): void
 | 
			
		||||
    {
 | 
			
		||||
        $collection = new ArrayCollection();
 | 
			
		||||
        $this->assertNull($this->collection->setCollection($collection));
 | 
			
		||||
        $this->assertEquals($collection, $this->collection->getCollection());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function testAdd(): void
 | 
			
		||||
    {
 | 
			
		||||
        $mock = new class() {
 | 
			
		||||
        };
 | 
			
		||||
        $this->collection->setCollection(new ArrayCollection());
 | 
			
		||||
        $this->assertTrue($this->collection->getCollection()->add($mock));
 | 
			
		||||
        $this->assertEquals($mock, $this->collection->getCollection()->get(0));
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -1,38 +0,0 @@
 | 
			
		||||
<?php
 | 
			
		||||
 | 
			
		||||
namespace Entity\Attribut;
 | 
			
		||||
 | 
			
		||||
use PHPUnit\Framework\TestCase;
 | 
			
		||||
use App\Entity\Attribut\ConditionAttributInterface;
 | 
			
		||||
use App\Entity\Attribut\ConditionAttribut;
 | 
			
		||||
use App\Logic\Operation\OperationInterface;
 | 
			
		||||
 | 
			
		||||
class ConditionAttributTest extends TestCase
 | 
			
		||||
{
 | 
			
		||||
    /**
 | 
			
		||||
     * @var ConditionAttributInterface
 | 
			
		||||
     */
 | 
			
		||||
    protected $condition;
 | 
			
		||||
 | 
			
		||||
    public function setUp(): void
 | 
			
		||||
    {
 | 
			
		||||
        $this->condition = new class() implements ConditionAttributInterface {
 | 
			
		||||
            use ConditionAttribut;
 | 
			
		||||
        };
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function testConstructor(): void
 | 
			
		||||
    {
 | 
			
		||||
        $this->expectException(\TypeError::class);
 | 
			
		||||
        $this->condition->getCondition();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function testAccessors(): void
 | 
			
		||||
    {
 | 
			
		||||
        $this->assertEquals(false, $this->condition->hasCondition());
 | 
			
		||||
        $condition = $this->createMock(OperationInterface::class);
 | 
			
		||||
        $this->assertNull($this->condition->setCondition($condition));
 | 
			
		||||
        $this->assertEquals(true, $this->condition->hasCondition());
 | 
			
		||||
        $this->assertEquals($condition, $this->condition->getCondition());
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -1,30 +0,0 @@
 | 
			
		||||
<?php
 | 
			
		||||
 | 
			
		||||
namespace App\Tests\Unit\Entity\Attribut;
 | 
			
		||||
 | 
			
		||||
use PHPUnit\Framework\TestCase;
 | 
			
		||||
use App\Entity\Attribut\CreatorRelationAttributInterface;
 | 
			
		||||
use App\Entity\Attribut\CreatorRelationAttribut;
 | 
			
		||||
use App\Entity\Meta\Relation\Parent\CreatorRelationInterface;
 | 
			
		||||
 | 
			
		||||
class CreatorRelationAttributTest extends TestCase
 | 
			
		||||
{
 | 
			
		||||
    /***
 | 
			
		||||
     * @var CreatorRelationAttributInterface
 | 
			
		||||
     */
 | 
			
		||||
    protected $creatorRelationAttribut;
 | 
			
		||||
 | 
			
		||||
    public function setUp(): void
 | 
			
		||||
    {
 | 
			
		||||
        $this->creatorRelationAttribut = new class() implements CreatorRelationAttributInterface {
 | 
			
		||||
            use CreatorRelationAttribut;
 | 
			
		||||
        };
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function testAccessors(): void
 | 
			
		||||
    {
 | 
			
		||||
        $relation = $this->createMock(CreatorRelationInterface::class);
 | 
			
		||||
        $this->assertNull($this->creatorRelationAttribut->setCreatorRelation($relation));
 | 
			
		||||
        $this->assertEquals($relation, $this->creatorRelationAttribut->getCreatorRelation());
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -1,43 +0,0 @@
 | 
			
		||||
<?php
 | 
			
		||||
 | 
			
		||||
namespace Tests\Unit\Entity\Attribut;
 | 
			
		||||
 | 
			
		||||
use PHPUnit\Framework\TestCase;
 | 
			
		||||
use App\Entity\Attribut\CrudAttributInterface;
 | 
			
		||||
use App\Entity\Attribut\CrudAttribut;
 | 
			
		||||
use App\DBAL\Types\Meta\Right\CRUDType;
 | 
			
		||||
use App\Exception\NoValidChoiceException;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @author kevinfrantz
 | 
			
		||||
 */
 | 
			
		||||
class CrudAttributTest extends TestCase
 | 
			
		||||
{
 | 
			
		||||
    /**
 | 
			
		||||
     * @var CrudAttributInterface
 | 
			
		||||
     */
 | 
			
		||||
    protected $crudAttribut;
 | 
			
		||||
 | 
			
		||||
    public function setUp(): void
 | 
			
		||||
    {
 | 
			
		||||
        $this->crudAttribut = new class() implements CrudAttributInterface {
 | 
			
		||||
            use CrudAttribut;
 | 
			
		||||
        };
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function testConstructor(): void
 | 
			
		||||
    {
 | 
			
		||||
        $this->expectException(\TypeError::class);
 | 
			
		||||
        $this->crudAttribut->getCrud();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function testAccessors(): void
 | 
			
		||||
    {
 | 
			
		||||
        foreach (CRUDType::getChoices() as $enum) {
 | 
			
		||||
            $this->assertNull($this->crudAttribut->setCrud($enum));
 | 
			
		||||
            $this->assertEquals($enum, $this->crudAttribut->getCrud());
 | 
			
		||||
        }
 | 
			
		||||
        $this->expectException(NoValidChoiceException::class);
 | 
			
		||||
        $this->crudAttribut->setCrud('NoneValidType');
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -1,39 +0,0 @@
 | 
			
		||||
<?php
 | 
			
		||||
 | 
			
		||||
namespace Tests\Unit\Entity\Attribut;
 | 
			
		||||
 | 
			
		||||
use PHPUnit\Framework\TestCase;
 | 
			
		||||
use App\Entity\Attribut\FirstNameSourceAttribut;
 | 
			
		||||
use App\Entity\Attribut\FirstNameSourceAttributInterface;
 | 
			
		||||
use App\Entity\Source\Primitive\Name\FirstNameSourceInterface;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @author kevinfrantz
 | 
			
		||||
 */
 | 
			
		||||
class FirstNameSourceAttributTest extends TestCase
 | 
			
		||||
{
 | 
			
		||||
    /**
 | 
			
		||||
     * @var FirstNameSourceAttributInterface
 | 
			
		||||
     */
 | 
			
		||||
    protected $name;
 | 
			
		||||
 | 
			
		||||
    public function setUp(): void
 | 
			
		||||
    {
 | 
			
		||||
        $this->name = new class() implements FirstNameSourceAttributInterface {
 | 
			
		||||
            use FirstNameSourceAttribut;
 | 
			
		||||
        };
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function testConstructor(): void
 | 
			
		||||
    {
 | 
			
		||||
        $this->expectException(\TypeError::class);
 | 
			
		||||
        $this->name->getFirstNameSource();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function testAccessors(): void
 | 
			
		||||
    {
 | 
			
		||||
        $name = $this->createMock(FirstNameSourceInterface::class);
 | 
			
		||||
        $this->assertNull($this->name->setFirstNameSource($name));
 | 
			
		||||
        $this->assertEquals($name, $this->name->getFirstNameSource());
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -1,39 +0,0 @@
 | 
			
		||||
<?php
 | 
			
		||||
 | 
			
		||||
namespace Tests\Unit\Entity\Attribut;
 | 
			
		||||
 | 
			
		||||
use PHPUnit\Framework\TestCase;
 | 
			
		||||
use App\Entity\Source\Complex\FullPersonNameSourceInterface;
 | 
			
		||||
use App\Entity\Attribut\FullPersonNameSourceAttributInterface;
 | 
			
		||||
use App\Entity\Attribut\FullPersonNameSourceAttribut;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @author kevinfrantz
 | 
			
		||||
 */
 | 
			
		||||
class FullPersonNameSourceAttributTest extends TestCase
 | 
			
		||||
{
 | 
			
		||||
    /**
 | 
			
		||||
     * @var FullPersonNameSourceAttributInterface
 | 
			
		||||
     */
 | 
			
		||||
    protected $fullname;
 | 
			
		||||
 | 
			
		||||
    public function setUp(): void
 | 
			
		||||
    {
 | 
			
		||||
        $this->fullname = new class() implements FullPersonNameSourceAttributInterface {
 | 
			
		||||
            use FullPersonNameSourceAttribut;
 | 
			
		||||
        };
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function testConstructor(): void
 | 
			
		||||
    {
 | 
			
		||||
        $this->expectException(\TypeError::class);
 | 
			
		||||
        $this->fullname->getFullPersonNameSource();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function testAccessors(): void
 | 
			
		||||
    {
 | 
			
		||||
        $fullname = $this->createMock(FullPersonNameSourceInterface::class);
 | 
			
		||||
        $this->assertNull($this->fullname->setFullPersonNameSource($fullname));
 | 
			
		||||
        $this->assertEquals($fullname, $this->fullname->getFullPersonNameSource());
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -1,35 +0,0 @@
 | 
			
		||||
<?php
 | 
			
		||||
 | 
			
		||||
namespace Tests\Unit\Entity\Attribut;
 | 
			
		||||
 | 
			
		||||
use PHPUnit\Framework\TestCase;
 | 
			
		||||
use App\Entity\Attribut\GrantAttribut;
 | 
			
		||||
use App\Entity\Attribut\GrantAttributInterface;
 | 
			
		||||
 | 
			
		||||
class GrantAttributTest extends TestCase
 | 
			
		||||
{
 | 
			
		||||
    /**
 | 
			
		||||
     * @var GrantAttributInterface
 | 
			
		||||
     */
 | 
			
		||||
    protected $grant;
 | 
			
		||||
 | 
			
		||||
    public function setUp(): void
 | 
			
		||||
    {
 | 
			
		||||
        $this->grant = new class() implements GrantAttributInterface {
 | 
			
		||||
            use GrantAttribut;
 | 
			
		||||
        };
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function testConstruct(): void
 | 
			
		||||
    {
 | 
			
		||||
        $this->expectException(\TypeError::class);
 | 
			
		||||
        $this->grant->getGrant();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function testAccessors(): void
 | 
			
		||||
    {
 | 
			
		||||
        $grant = true;
 | 
			
		||||
        $this->assertNull($this->grant->setGrant($grant));
 | 
			
		||||
        $this->assertEquals($grant, $this->grant->getGrant());
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -1,42 +0,0 @@
 | 
			
		||||
<?php
 | 
			
		||||
 | 
			
		||||
namespace Tests\Unit\Entity\Attribut;
 | 
			
		||||
 | 
			
		||||
use PHPUnit\Framework\TestCase;
 | 
			
		||||
use App\Entity\Attribut\IdAttribut;
 | 
			
		||||
use App\Entity\Attribut\IdAttributInterface;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @author kevinfrantz
 | 
			
		||||
 */
 | 
			
		||||
class IdAttributTest extends TestCase
 | 
			
		||||
{
 | 
			
		||||
    /**
 | 
			
		||||
     * @var IdAttributInterface
 | 
			
		||||
     */
 | 
			
		||||
    protected $id;
 | 
			
		||||
 | 
			
		||||
    public function setUp(): void
 | 
			
		||||
    {
 | 
			
		||||
        $this->id = new class() implements IdAttributInterface {
 | 
			
		||||
            use IdAttribut;
 | 
			
		||||
        };
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function testConstruct(): void
 | 
			
		||||
    {
 | 
			
		||||
        $this->assertFalse($this->id->hasId());
 | 
			
		||||
        $this->expectException(\TypeError::class);
 | 
			
		||||
        $this->id->getId();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function testAccessors(): void
 | 
			
		||||
    {
 | 
			
		||||
        $id = 1234;
 | 
			
		||||
        $this->assertNull($this->id->setId($id));
 | 
			
		||||
        $this->assertEquals($id, $this->id->getId());
 | 
			
		||||
        $this->assertTrue($this->id->hasId());
 | 
			
		||||
        $this->assertNull($this->id->setId(0));
 | 
			
		||||
        $this->assertTrue($this->id->hasId());
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -1,43 +0,0 @@
 | 
			
		||||
<?php
 | 
			
		||||
 | 
			
		||||
namespace Tests\Unit\Entity\Attribut;
 | 
			
		||||
 | 
			
		||||
use PHPUnit\Framework\TestCase;
 | 
			
		||||
use App\Entity\Attribut\LayerAttributInterface;
 | 
			
		||||
use App\Entity\Attribut\LayerAttribut;
 | 
			
		||||
use App\DBAL\Types\Meta\Right\LayerType;
 | 
			
		||||
use App\Exception\NoValidChoiceException;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @author kevinfrantz
 | 
			
		||||
 */
 | 
			
		||||
class LayerAttributTest extends TestCase
 | 
			
		||||
{
 | 
			
		||||
    /**
 | 
			
		||||
     * @var LayerAttributInterface
 | 
			
		||||
     */
 | 
			
		||||
    protected $layerAttribut;
 | 
			
		||||
 | 
			
		||||
    public function setUp(): void
 | 
			
		||||
    {
 | 
			
		||||
        $this->layerAttribut = new class() implements LayerAttributInterface {
 | 
			
		||||
            use LayerAttribut;
 | 
			
		||||
        };
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function testConstruct(): void
 | 
			
		||||
    {
 | 
			
		||||
        $this->expectException(\TypeError::class);
 | 
			
		||||
        $this->layerAttribut->getLayer();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function testAccessors(): void
 | 
			
		||||
    {
 | 
			
		||||
        foreach (LayerType::getChoices() as $enum) {
 | 
			
		||||
            $this->assertNull($this->layerAttribut->setLayer($enum));
 | 
			
		||||
            $this->assertEquals($enum, $this->layerAttribut->getLayer());
 | 
			
		||||
        }
 | 
			
		||||
        $this->expectException(NoValidChoiceException::class);
 | 
			
		||||
        $this->layerAttribut->setLayer('NoneValidLayer');
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -1,36 +0,0 @@
 | 
			
		||||
<?php
 | 
			
		||||
 | 
			
		||||
namespace Tests\Unit\Entity\Attribut;
 | 
			
		||||
 | 
			
		||||
use PHPUnit\Framework\TestCase;
 | 
			
		||||
use App\Entity\Attribut\MemberRelationAttributInterface;
 | 
			
		||||
use App\Entity\Attribut\MemberRelationAttribut;
 | 
			
		||||
use App\Entity\Meta\Relation\Member\MemberRelationInterface;
 | 
			
		||||
 | 
			
		||||
class MemberRelationAttributTest extends TestCase
 | 
			
		||||
{
 | 
			
		||||
    /**
 | 
			
		||||
     * @var MemberRelationAttributInterface
 | 
			
		||||
     */
 | 
			
		||||
    protected $memberRelation;
 | 
			
		||||
 | 
			
		||||
    public function setUp(): void
 | 
			
		||||
    {
 | 
			
		||||
        $this->memberRelation = new class() implements MemberRelationAttributInterface {
 | 
			
		||||
            use MemberRelationAttribut;
 | 
			
		||||
        };
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function testConstructor(): void
 | 
			
		||||
    {
 | 
			
		||||
        $this->expectException(\TypeError::class);
 | 
			
		||||
        $this->memberRelation->getMemberRelation();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function testAccessors(): void
 | 
			
		||||
    {
 | 
			
		||||
        $membership = $this->createMock(MemberRelationInterface::class);
 | 
			
		||||
        $this->assertNull($this->memberRelation->setMemberRelation($membership));
 | 
			
		||||
        $this->assertEquals($this->memberRelation->getMemberRelation(), $membership);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -1,37 +0,0 @@
 | 
			
		||||
<?php
 | 
			
		||||
 | 
			
		||||
namespace Tests\Unit\Entity\Attribut;
 | 
			
		||||
 | 
			
		||||
use PHPUnit\Framework\TestCase;
 | 
			
		||||
use Doctrine\Common\Collections\ArrayCollection;
 | 
			
		||||
use App\Entity\Attribut\MembersAttributInterface;
 | 
			
		||||
use App\Entity\Source\SourceInterface;
 | 
			
		||||
use App\Entity\Attribut\MembersAttribut;
 | 
			
		||||
 | 
			
		||||
class MembersAttributTest extends TestCase
 | 
			
		||||
{
 | 
			
		||||
    /**
 | 
			
		||||
     * @var MembersAttributInterface
 | 
			
		||||
     */
 | 
			
		||||
    protected $members;
 | 
			
		||||
 | 
			
		||||
    public function setUp(): void
 | 
			
		||||
    {
 | 
			
		||||
        $this->members = new class() implements MembersAttributInterface {
 | 
			
		||||
            use MembersAttribut;
 | 
			
		||||
        };
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function testConstructor(): void
 | 
			
		||||
    {
 | 
			
		||||
        $this->expectException(\TypeError::class);
 | 
			
		||||
        $this->members->getMembers();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function testAccessors(): void
 | 
			
		||||
    {
 | 
			
		||||
        $membership = $this->createMock(SourceInterface::class);
 | 
			
		||||
        $this->assertNull($this->members->setMembers(new ArrayCollection([$membership])));
 | 
			
		||||
        $this->assertEquals($this->members->getMembers()->get(0), $membership);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -1,37 +0,0 @@
 | 
			
		||||
<?php
 | 
			
		||||
 | 
			
		||||
namespace Tests\Unit\Entity\Attribut;
 | 
			
		||||
 | 
			
		||||
use PHPUnit\Framework\TestCase;
 | 
			
		||||
use App\Entity\Attribut\MembershipsAttributInterface;
 | 
			
		||||
use App\Entity\Attribut\MembershipsAttribut;
 | 
			
		||||
use Doctrine\Common\Collections\ArrayCollection;
 | 
			
		||||
use App\Entity\Source\Complex\Collection\TreeCollectionSourceInterface;
 | 
			
		||||
 | 
			
		||||
class MembershipsAttributTest extends TestCase
 | 
			
		||||
{
 | 
			
		||||
    /**
 | 
			
		||||
     * @var MembershipsAttributInterface
 | 
			
		||||
     */
 | 
			
		||||
    protected $memberships;
 | 
			
		||||
 | 
			
		||||
    public function setUp(): void
 | 
			
		||||
    {
 | 
			
		||||
        $this->memberships = new class() implements MembershipsAttributInterface {
 | 
			
		||||
            use MembershipsAttribut;
 | 
			
		||||
        };
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function testConstructor(): void
 | 
			
		||||
    {
 | 
			
		||||
        $this->expectException(\TypeError::class);
 | 
			
		||||
        $this->memberships->getMemberships();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function testAccessors(): void
 | 
			
		||||
    {
 | 
			
		||||
        $membership = $this->createMock(TreeCollectionSourceInterface::class);
 | 
			
		||||
        $this->assertNull($this->memberships->setMemberships(new ArrayCollection([$membership])));
 | 
			
		||||
        $this->assertEquals($this->memberships->getMemberships()->get(0), $membership);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -1,33 +0,0 @@
 | 
			
		||||
<?php
 | 
			
		||||
 | 
			
		||||
namespace App\Entity\Attribut;
 | 
			
		||||
 | 
			
		||||
use PHPUnit\Framework\TestCase;
 | 
			
		||||
 | 
			
		||||
class NameAttributTest extends TestCase
 | 
			
		||||
{
 | 
			
		||||
    /**
 | 
			
		||||
     * @var NameAttributInterface
 | 
			
		||||
     */
 | 
			
		||||
    public $name;
 | 
			
		||||
 | 
			
		||||
    public function setUp(): void
 | 
			
		||||
    {
 | 
			
		||||
        $this->name = new class() implements NameAttributInterface {
 | 
			
		||||
            use NameAttribut;
 | 
			
		||||
        };
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function testConstructor(): void
 | 
			
		||||
    {
 | 
			
		||||
        $this->expectException(\TypeError::class);
 | 
			
		||||
        $this->name->getName();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function testAccessors(): void
 | 
			
		||||
    {
 | 
			
		||||
        $name = 'hello world!';
 | 
			
		||||
        $this->assertNull($this->name->setName($name));
 | 
			
		||||
        $this->assertEquals($name, $this->name->getName());
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -1,36 +0,0 @@
 | 
			
		||||
<?php
 | 
			
		||||
 | 
			
		||||
namespace tests\unit\Entity\Attribut;
 | 
			
		||||
 | 
			
		||||
use PHPUnit\Framework\TestCase;
 | 
			
		||||
use App\Entity\Attribut\NameSourceAttributInterface;
 | 
			
		||||
use App\Entity\Attribut\NameSourceAttribut;
 | 
			
		||||
use App\Entity\Source\Primitive\Name\NameSourceInterface;
 | 
			
		||||
 | 
			
		||||
class NameSourceAttributTest extends TestCase
 | 
			
		||||
{
 | 
			
		||||
    /**
 | 
			
		||||
     * @var NameSourceAttributInterface
 | 
			
		||||
     */
 | 
			
		||||
    protected $name;
 | 
			
		||||
 | 
			
		||||
    public function setUp(): void
 | 
			
		||||
    {
 | 
			
		||||
        $this->name = new class() implements NameSourceAttributInterface {
 | 
			
		||||
            use NameSourceAttribut;
 | 
			
		||||
        };
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function testConstructor(): void
 | 
			
		||||
    {
 | 
			
		||||
        $this->expectException(\TypeError::class);
 | 
			
		||||
        $this->name->getNameSource();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function testAccessors(): void
 | 
			
		||||
    {
 | 
			
		||||
        $nameSource = $this->createMock(NameSourceInterface::class);
 | 
			
		||||
        $this->assertNull($this->name->setNameSource($nameSource));
 | 
			
		||||
        $this->assertEquals($nameSource, $this->name->getNameSource());
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -1,30 +0,0 @@
 | 
			
		||||
<?php
 | 
			
		||||
 | 
			
		||||
namespace App\Tests\Unit\Entity\Attribut;
 | 
			
		||||
 | 
			
		||||
use PHPUnit\Framework\TestCase;
 | 
			
		||||
use App\Entity\Attribut\ParentRelationAttributInterface;
 | 
			
		||||
use App\Entity\Attribut\ParentRelationAttribut;
 | 
			
		||||
use App\Entity\Meta\Relation\Parent\ParentRelationInterface;
 | 
			
		||||
 | 
			
		||||
class ParentRelationAttributTest extends TestCase
 | 
			
		||||
{
 | 
			
		||||
    /***
 | 
			
		||||
     * @var ParentRelationAttributInterface
 | 
			
		||||
     */
 | 
			
		||||
    protected $parentRelationAttribut;
 | 
			
		||||
 | 
			
		||||
    public function setUp(): void
 | 
			
		||||
    {
 | 
			
		||||
        $this->parentRelationAttribut = new class() implements ParentRelationAttributInterface {
 | 
			
		||||
            use ParentRelationAttribut;
 | 
			
		||||
        };
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function testAccessors(): void
 | 
			
		||||
    {
 | 
			
		||||
        $relation = $this->createMock(ParentRelationInterface::class);
 | 
			
		||||
        $this->assertNull($this->parentRelationAttribut->setParentRelation($relation));
 | 
			
		||||
        $this->assertEquals($relation, $this->parentRelationAttribut->getParentRelation());
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -1,36 +0,0 @@
 | 
			
		||||
<?php
 | 
			
		||||
 | 
			
		||||
namespace Entity\Attribut;
 | 
			
		||||
 | 
			
		||||
use PHPUnit\Framework\TestCase;
 | 
			
		||||
use App\Entity\Attribut\ParentsAttributInterface;
 | 
			
		||||
use App\Entity\Attribut\ParentsAttribut;
 | 
			
		||||
use Doctrine\Common\Collections\ArrayCollection;
 | 
			
		||||
 | 
			
		||||
class ParentsAttributTest extends TestCase
 | 
			
		||||
{
 | 
			
		||||
    /**
 | 
			
		||||
     * @var ParentsAttributInterface
 | 
			
		||||
     */
 | 
			
		||||
    protected $parents;
 | 
			
		||||
 | 
			
		||||
    public function setUp(): void
 | 
			
		||||
    {
 | 
			
		||||
        $this->parents = new class() implements ParentsAttributInterface {
 | 
			
		||||
            use ParentsAttribut;
 | 
			
		||||
        };
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function testConstructor(): void
 | 
			
		||||
    {
 | 
			
		||||
        $this->expectException(\TypeError::class);
 | 
			
		||||
        $this->parents->getParents();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function testAccessors(): void
 | 
			
		||||
    {
 | 
			
		||||
        $parents = new ArrayCollection();
 | 
			
		||||
        $this->assertNull($this->parents->setParents($parents));
 | 
			
		||||
        $this->assertEquals($parents, $this->parents->getParents());
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -1,41 +0,0 @@
 | 
			
		||||
<?php
 | 
			
		||||
 | 
			
		||||
namespace Tests\Unit\Entity\Attribut;
 | 
			
		||||
 | 
			
		||||
use PHPUnit\Framework\TestCase;
 | 
			
		||||
use App\Entity\Attribut\PersonIdentitySourceAttributInterface;
 | 
			
		||||
use App\Entity\Attribut\PersonIdentitySourceAttribut;
 | 
			
		||||
use App\Entity\Source\Complex\PersonIdentitySourceInterface;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @todo Implement abstract test class for entity attributs
 | 
			
		||||
 *
 | 
			
		||||
 * @author kevinfrantz
 | 
			
		||||
 */
 | 
			
		||||
class PersonIdentitySourceAttributTest extends TestCase
 | 
			
		||||
{
 | 
			
		||||
    /**
 | 
			
		||||
     * @var PersonIdentitySourceAttributInterface
 | 
			
		||||
     */
 | 
			
		||||
    protected $identity;
 | 
			
		||||
 | 
			
		||||
    public function setUp(): void
 | 
			
		||||
    {
 | 
			
		||||
        $this->identity = new class() implements PersonIdentitySourceAttributInterface {
 | 
			
		||||
            use PersonIdentitySourceAttribut;
 | 
			
		||||
        };
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function testConstructor(): void
 | 
			
		||||
    {
 | 
			
		||||
        $this->expectException(\TypeError::class);
 | 
			
		||||
        $this->identity->getPersonIdentitySource();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function testAccessors(): void
 | 
			
		||||
    {
 | 
			
		||||
        $identity = $this->createMock(PersonIdentitySourceInterface::class);
 | 
			
		||||
        $this->assertNull($this->identity->setPersonIdentitySource($identity));
 | 
			
		||||
        $this->assertEquals($identity, $this->identity->getPersonIdentitySource());
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -1,38 +0,0 @@
 | 
			
		||||
<?php
 | 
			
		||||
 | 
			
		||||
namespace Tests\Unit\Entity\Attribut;
 | 
			
		||||
 | 
			
		||||
use PHPUnit\Framework\TestCase;
 | 
			
		||||
use App\Entity\Attribut\PriorityAttributInterface;
 | 
			
		||||
use App\Entity\Attribut\PriorityAttribut;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @author kevinfrantz
 | 
			
		||||
 */
 | 
			
		||||
class PriorityAttributTest extends TestCase
 | 
			
		||||
{
 | 
			
		||||
    /**
 | 
			
		||||
     * @var PriorityAttributInterface
 | 
			
		||||
     */
 | 
			
		||||
    protected $priorityAttribut;
 | 
			
		||||
 | 
			
		||||
    public function setUp(): void
 | 
			
		||||
    {
 | 
			
		||||
        $this->priorityAttribut = new class() implements PriorityAttributInterface {
 | 
			
		||||
            use PriorityAttribut;
 | 
			
		||||
        };
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function testConstructor(): void
 | 
			
		||||
    {
 | 
			
		||||
        $this->expectException(\TypeError::class);
 | 
			
		||||
        $this->priorityAttribut->getPriority();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function testAccessors(): void
 | 
			
		||||
    {
 | 
			
		||||
        $priority = 123;
 | 
			
		||||
        $this->assertNull($this->priorityAttribut->setPriority($priority));
 | 
			
		||||
        $this->assertEquals($priority, $this->priorityAttribut->getPriority());
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -1,36 +0,0 @@
 | 
			
		||||
<?php
 | 
			
		||||
 | 
			
		||||
namespace Tests\Unit\Entity\Attribut;
 | 
			
		||||
 | 
			
		||||
use PHPUnit\Framework\TestCase;
 | 
			
		||||
use App\Entity\Attribut\RecieverAttributInterface;
 | 
			
		||||
use App\Entity\Attribut\RecieverAttribut;
 | 
			
		||||
use App\Entity\Source\AbstractSource;
 | 
			
		||||
 | 
			
		||||
class RecieverAttributTest extends TestCase
 | 
			
		||||
{
 | 
			
		||||
    /**
 | 
			
		||||
     * @var RecieverAttributInterface
 | 
			
		||||
     */
 | 
			
		||||
    protected $reciever;
 | 
			
		||||
 | 
			
		||||
    public function setUp(): void
 | 
			
		||||
    {
 | 
			
		||||
        $this->reciever = new class() implements RecieverAttributInterface {
 | 
			
		||||
            use RecieverAttribut;
 | 
			
		||||
        };
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function testConstructor(): void
 | 
			
		||||
    {
 | 
			
		||||
        $this->expectException(\TypeError::class);
 | 
			
		||||
        $this->reciever->getReciever();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function testAccessors(): void
 | 
			
		||||
    {
 | 
			
		||||
        $reciever = $this->createMock(AbstractSource::class);
 | 
			
		||||
        $this->assertNull($this->reciever->setReciever($reciever));
 | 
			
		||||
        $this->assertEquals($reciever, $this->reciever->getReciever());
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -1,30 +0,0 @@
 | 
			
		||||
<?php
 | 
			
		||||
 | 
			
		||||
namespace App\Tests\Unit\Entity\Attribut;
 | 
			
		||||
 | 
			
		||||
use PHPUnit\Framework\TestCase;
 | 
			
		||||
use App\Entity\Meta\Relation\RelationInterface;
 | 
			
		||||
use App\Entity\Attribut\RelationAttributInterface;
 | 
			
		||||
use App\Entity\Attribut\RelationAttribut;
 | 
			
		||||
 | 
			
		||||
class RelationAttributTest extends TestCase
 | 
			
		||||
{
 | 
			
		||||
    /***
 | 
			
		||||
     * @var RelationAttributInterface
 | 
			
		||||
     */
 | 
			
		||||
    protected $relationAttribut;
 | 
			
		||||
 | 
			
		||||
    public function setUp(): void
 | 
			
		||||
    {
 | 
			
		||||
        $this->relationAttribut = new class() implements RelationAttributInterface {
 | 
			
		||||
            use RelationAttribut;
 | 
			
		||||
        };
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function testAccessors(): void
 | 
			
		||||
    {
 | 
			
		||||
        $relation = $this->createMock(RelationInterface::class);
 | 
			
		||||
        $this->assertNull($this->relationAttribut->setRelation($relation));
 | 
			
		||||
        $this->assertEquals($relation, $this->relationAttribut->getRelation());
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -1,30 +0,0 @@
 | 
			
		||||
<?php
 | 
			
		||||
 | 
			
		||||
namespace App\Tests\Unit\Entity\Attribut;
 | 
			
		||||
 | 
			
		||||
use PHPUnit\Framework\TestCase;
 | 
			
		||||
use App\Entity\Attribut\RightAttributInterface;
 | 
			
		||||
use App\Entity\Attribut\RightAttribut;
 | 
			
		||||
use App\Entity\Meta\RightInterface;
 | 
			
		||||
 | 
			
		||||
class RightAttributTest extends TestCase
 | 
			
		||||
{
 | 
			
		||||
    /***
 | 
			
		||||
     * @var RightAttributInterface
 | 
			
		||||
     */
 | 
			
		||||
    private $rightAttribut;
 | 
			
		||||
 | 
			
		||||
    public function setUp(): void
 | 
			
		||||
    {
 | 
			
		||||
        $this->rightAttribut = new class() implements RightAttributInterface {
 | 
			
		||||
            use RightAttribut;
 | 
			
		||||
        };
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function testAccessors(): void
 | 
			
		||||
    {
 | 
			
		||||
        $right = $this->createMock(RightInterface::class);
 | 
			
		||||
        $this->assertNull($this->rightAttribut->setRight($right));
 | 
			
		||||
        $this->assertEquals($right, $this->rightAttribut->getRight());
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -1,42 +0,0 @@
 | 
			
		||||
<?php
 | 
			
		||||
 | 
			
		||||
namespace Tests\Entity\Attribut;
 | 
			
		||||
 | 
			
		||||
use PHPUnit\Framework\TestCase;
 | 
			
		||||
use App\Entity\Attribut\SlugAttributInterface;
 | 
			
		||||
use App\Entity\Attribut\SlugAttribut;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @author kevinfrantz
 | 
			
		||||
 */
 | 
			
		||||
class SlugAttributTest extends TestCase
 | 
			
		||||
{
 | 
			
		||||
    /**
 | 
			
		||||
     * @var SlugAttributInterface
 | 
			
		||||
     */
 | 
			
		||||
    protected $slugAttribut;
 | 
			
		||||
 | 
			
		||||
    public function setUp(): void
 | 
			
		||||
    {
 | 
			
		||||
        $this->slugAttribut = new class() implements SlugAttributInterface {
 | 
			
		||||
            use SlugAttribut;
 | 
			
		||||
        };
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function testConstructor(): void
 | 
			
		||||
    {
 | 
			
		||||
        $this->assertFalse($this->slugAttribut->hasSlug());
 | 
			
		||||
        $this->expectException(\TypeError::class);
 | 
			
		||||
        $this->slugAttribut->getSlug();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function testAccessors(): void
 | 
			
		||||
    {
 | 
			
		||||
        $slug = 'goodslug';
 | 
			
		||||
        $this->assertNull($this->slugAttribut->setSlug($slug));
 | 
			
		||||
        $this->assertTrue($this->slugAttribut->hasSlug());
 | 
			
		||||
        $this->assertEquals($slug, $this->slugAttribut->getSlug());
 | 
			
		||||
        $this->assertNull($this->slugAttribut->setSlug(''));
 | 
			
		||||
        $this->assertTrue($this->slugAttribut->hasSlug());
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -1,38 +0,0 @@
 | 
			
		||||
<?php
 | 
			
		||||
 | 
			
		||||
namespace Tests\Unit\Entity\Attribut;
 | 
			
		||||
 | 
			
		||||
use PHPUnit\Framework\TestCase;
 | 
			
		||||
use App\Entity\Attribut\TextAttributInterface;
 | 
			
		||||
use App\Entity\Attribut\TextAttribut;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @author kevinfrantz
 | 
			
		||||
 */
 | 
			
		||||
class TextAttributTest extends TestCase
 | 
			
		||||
{
 | 
			
		||||
    /**
 | 
			
		||||
     * @var TextAttributInterface
 | 
			
		||||
     */
 | 
			
		||||
    protected $textAttribut;
 | 
			
		||||
 | 
			
		||||
    public function setUp(): void
 | 
			
		||||
    {
 | 
			
		||||
        $this->textAttribut = new class() implements TextAttributInterface {
 | 
			
		||||
            use TextAttribut;
 | 
			
		||||
        };
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function testConstructor(): void
 | 
			
		||||
    {
 | 
			
		||||
        $this->expectException(\TypeError::class);
 | 
			
		||||
        $this->textAttribut->getText();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function testAccessors(): void
 | 
			
		||||
    {
 | 
			
		||||
        $text = 'Hello World!';
 | 
			
		||||
        $this->assertNull($this->textAttribut->setText($text));
 | 
			
		||||
        $this->assertEquals($text, $this->textAttribut->getText());
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -1,36 +0,0 @@
 | 
			
		||||
<?php
 | 
			
		||||
 | 
			
		||||
namespace Tests\Unit\Entity\Attribut;
 | 
			
		||||
 | 
			
		||||
use PHPUnit\Framework\TestCase;
 | 
			
		||||
use App\Entity\Attribut\UserAttributInterface;
 | 
			
		||||
use App\Entity\Attribut\UserAttribut;
 | 
			
		||||
use App\Entity\UserInterface;
 | 
			
		||||
 | 
			
		||||
class UserAttributTest extends TestCase
 | 
			
		||||
{
 | 
			
		||||
    /**
 | 
			
		||||
     * @var UserAttributInterface
 | 
			
		||||
     */
 | 
			
		||||
    public $user;
 | 
			
		||||
 | 
			
		||||
    public function setUp(): void
 | 
			
		||||
    {
 | 
			
		||||
        $this->user = new class() implements UserAttributInterface {
 | 
			
		||||
            use UserAttribut;
 | 
			
		||||
        };
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function testConstructor(): void
 | 
			
		||||
    {
 | 
			
		||||
        $this->expectException(\TypeError::class);
 | 
			
		||||
        $this->user->getUser();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function testAccessors(): void
 | 
			
		||||
    {
 | 
			
		||||
        $user = $this->createMock(UserInterface::class);
 | 
			
		||||
        $this->assertNull($this->user->setUser($user));
 | 
			
		||||
        $this->assertEquals($user, $this->user->getUser());
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user