mirror of
				https://github.com/kevinveenbirkenbach/infinito.git
				synced 2025-10-31 01:09:41 +00:00 
			
		
		
		
	Continued the integration of person identity
This commit is contained in:
		| @@ -0,0 +1,39 @@ | ||||
| <?php | ||||
|  | ||||
| namespace Tests\Unit\Entity\Attribut; | ||||
|  | ||||
| use PHPUnit\Framework\TestCase; | ||||
| use App\Entity\Source\Combination\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($collection, $this->fullname->getFullPersonNameSource()); | ||||
|     } | ||||
| } | ||||
| @@ -0,0 +1,41 @@ | ||||
| <?php | ||||
|  | ||||
| namespace Tests\Unit\Entity\Attribut; | ||||
|  | ||||
| use PHPUnit\Framework\TestCase; | ||||
| use App\Entity\Attribut\PersonIdentitySourceAttributInterface; | ||||
| use Entity\Attribut\PersonIdentityAttribut; | ||||
| use App\Entity\Source\Data\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 PersonIdentityAttribut; | ||||
|         }; | ||||
|     } | ||||
|  | ||||
|     public function testConstructor(): void | ||||
|     { | ||||
|         $this->expectException(\TypeError::class); | ||||
|         $this->identity->getIdentitySource(); | ||||
|     } | ||||
|  | ||||
|     public function testAccessors(): void | ||||
|     { | ||||
|         $identity = $this->createMock(PersonIdentitySourceInterface::class); | ||||
|         $this->assertNull($this->identity->setIdentitySource($identity)); | ||||
|         $this->assertEquals($collection, $this->identity->getIdentitySource()); | ||||
|     } | ||||
| } | ||||
| @@ -1,12 +1,12 @@ | ||||
| <?php | ||||
| 
 | ||||
| namespace tests\unit\Entity\Source\Data; | ||||
| namespace tests\unit\Entity\Source\Combination; | ||||
| 
 | ||||
| use PHPUnit\Framework\TestCase; | ||||
| use App\Entity\Source\Data\UserSourceInterface; | ||||
| use App\Entity\Source\Data\UserSource; | ||||
| use Doctrine\Common\Collections\Collection; | ||||
| use App\Entity\Source\Data\NameSourceInterface; | ||||
| use App\Entity\Source\Data\PersonIdentitySourceInterface; | ||||
| 
 | ||||
| class UserSourceTest extends TestCase | ||||
| { | ||||
| @@ -23,7 +23,7 @@ class UserSourceTest extends TestCase | ||||
|     public function testConstructor(): void | ||||
|     { | ||||
|         $this->assertInstanceOf(Collection::class, $this->userSource->getMemberships()); | ||||
|         $this->assertInstanceOf(NameSourceInterface::class, $this->userSource->getNameSource()); | ||||
|         $this->assertInstanceOf(PersonIdentitySourceInterface::class, $this->userSource->getIdentitySource()); | ||||
|         $this->expectException(\TypeError::class); | ||||
|         $this->userSource->getUser(); | ||||
|     } | ||||
| @@ -1,4 +1,5 @@ | ||||
| <?php | ||||
|  | ||||
| namespace tests\unit\Entity\Source\Data; | ||||
|  | ||||
| use PHPUnit\Framework\TestCase; | ||||
| @@ -12,19 +13,21 @@ class IdentitySourceTest extends TestCase | ||||
|      * @var IdentityInterface | ||||
|      */ | ||||
|     protected $identity; | ||||
|      | ||||
|     public function setUp():void{ | ||||
|  | ||||
|     public function setUp(): void | ||||
|     { | ||||
|         $this->identity = new IdentitySource(); | ||||
|     } | ||||
|      | ||||
|     public function testConstructor():void{ | ||||
|  | ||||
|     public function testConstructor(): void | ||||
|     { | ||||
|         $this->assertInstanceOf(FullPersonNameSourceInterface::class, $this->identity->getName()); | ||||
|     } | ||||
|      | ||||
|     public function testName():void{ | ||||
|  | ||||
|     public function testName(): void | ||||
|     { | ||||
|         $name = $this->createMock(FullPersonNameSourceInterface::class); | ||||
|         $this->assertNull($this->identity->setName($name)); | ||||
|         $this->assertEquals($name, $this->identity->getName()); | ||||
|     } | ||||
| } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user