mirror of
				https://github.com/kevinveenbirkenbach/infinito.git
				synced 2025-10-31 01:09:41 +00:00 
			
		
		
		
	Added Text source
This commit is contained in:
		
							
								
								
									
										38
									
								
								application/tests/Unit/Entity/Attribut/TextAttributTest.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										38
									
								
								application/tests/Unit/Entity/Attribut/TextAttributTest.php
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,38 @@ | ||||
| <?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()); | ||||
|     } | ||||
| } | ||||
| @@ -0,0 +1,26 @@ | ||||
| <?php | ||||
|  | ||||
| namespace Tests\Unit\Entity\Source\Primitive\Text; | ||||
|  | ||||
| use PHPUnit\Framework\TestCase; | ||||
| use App\Entity\Source\Primitive\Text\TextSourceInterface; | ||||
| use App\Entity\Source\Primitive\Text\TextSource; | ||||
|  | ||||
| class TextSourceTest extends TestCase | ||||
| { | ||||
|     /** | ||||
|      * @var TextSourceInterface | ||||
|      */ | ||||
|     protected $textSource; | ||||
|  | ||||
|     public function setUp(): void | ||||
|     { | ||||
|         $this->textSource = new TextSource(); | ||||
|     } | ||||
|  | ||||
|     public function testConstructor(): void | ||||
|     { | ||||
|         $this->expectException(\TypeError::class); | ||||
|         $this->textSource->getText(); | ||||
|     } | ||||
| } | ||||
		Reference in New Issue
	
	Block a user