mirror of
				https://github.com/kevinveenbirkenbach/infinito.git
				synced 2025-10-31 09:19:08 +00:00 
			
		
		
		
	Continued integration of CreatorParent
This commit is contained in:
		| @@ -0,0 +1,33 @@ | ||||
| <?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; | ||||
| use App\Entity\Attribut\CreatorRelationAttributInterface; | ||||
| use App\Entity\Attribut\CreatorRelationAttribut; | ||||
| use App\Entity\Meta\Relation\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()); | ||||
|     } | ||||
| } | ||||
| @@ -0,0 +1,30 @@ | ||||
| <?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()); | ||||
|     } | ||||
| } | ||||
| @@ -9,6 +9,7 @@ use App\Entity\Meta\RelationInterface; | ||||
| use Doctrine\Common\Collections\Collection; | ||||
| use App\Entity\Source\AbstractSource; | ||||
| use App\Entity\EntityInterface; | ||||
| use App\Entity\Meta\Relation\CreatorRelationInterface; | ||||
|  | ||||
| /** | ||||
|  * @author kevinfrantz | ||||
| @@ -34,9 +35,11 @@ class AbstractSourceTest extends TestCase | ||||
|     public function testConstructor(): void | ||||
|     { | ||||
|         $this->assertInstanceOf(EntityInterface::class, $this->source); | ||||
|         $this->assertInstanceOf(RelationInterface::class, $this->source->getRelation()); | ||||
|         $this->assertInstanceOf(CreatorRelationInterface::class, $this->source->getCreatorRelation()); | ||||
|         $this->assertEquals($this->source, $this->source->getCreatorRelation()->getSource()); | ||||
|         $this->assertInstanceOf(Collection::class, $this->source->getMemberships()); | ||||
|         $this->assertInstanceOf(LawInterface::class, $this->source->getLaw()); | ||||
|         $this->assertEquals($this->source, $this->source->getLaw()->getSource()); | ||||
|         $this->assertInstanceOf(Collection::class, $this->source->getMembers()); | ||||
|     } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user