mirror of
				https://github.com/kevinveenbirkenbach/infinito.git
				synced 2025-10-31 17:29:04 +00:00 
			
		
		
		
	Optimized FormMeta and Tests
This commit is contained in:
		
							
								
								
									
										34
									
								
								application/tests/Unit/Domain/FormMetaTest.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										34
									
								
								application/tests/Unit/Domain/FormMetaTest.php
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,34 @@ | ||||
| <?php | ||||
|  | ||||
| namespace Tests\Unit\Domain; | ||||
|  | ||||
| use PHPUnit\Framework\TestCase; | ||||
| use App\Domain\FormManagement\FormMetaInterface; | ||||
| use App\Domain\FormManagement\FormMeta; | ||||
| use App\Entity\Source\Primitive\Name\SurnameSource; | ||||
| use App\Domain\SourceManagement\SourceMeta; | ||||
| use App\Domain\TemplateManagement\TemplateMetaInterface; | ||||
|  | ||||
| class FormMetaTest extends TestCase | ||||
| { | ||||
|     /** | ||||
|      * @var FormMetaInterface | ||||
|      */ | ||||
|     protected $formMeta; | ||||
|  | ||||
|     public function setUp(): void | ||||
|     { | ||||
|         $sourceMeta = new SourceMeta(new SurnameSource()); | ||||
|         $this->formMeta = new FormMeta($sourceMeta); | ||||
|     } | ||||
|  | ||||
|     public function testGetFormClass(): void | ||||
|     { | ||||
|         $this->assertEquals('App\Form\Source\Primitive\Name\SurnameType', $this->formMeta->getFormClass()); | ||||
|     } | ||||
|  | ||||
|     public function testTemplateMeta(): void | ||||
|     { | ||||
|         $this->assertInstanceOf(TemplateMetaInterface::class, $this->formMeta->getTemplateMeta()); | ||||
|     } | ||||
| } | ||||
| @@ -9,6 +9,7 @@ use App\Domain\SourceManagement\SourceMeta; | ||||
| use App\Entity\Source\Complex\UserSourceInterface; | ||||
| use App\Domain\TemplateManagement\TemplateMetaInterface; | ||||
| use App\Entity\Source\SourceInterface; | ||||
| use App\Domain\FormManagement\FormMetaInterface; | ||||
|  | ||||
| class SourceMetaTest extends TestCase | ||||
| { | ||||
| @@ -73,4 +74,9 @@ class SourceMetaTest extends TestCase | ||||
|     { | ||||
|         $this->assertEquals($this->source, $this->sourceMeta->getSource()); | ||||
|     } | ||||
|  | ||||
|     public function testFormMeta(): void | ||||
|     { | ||||
|         $this->assertInstanceOf(FormMetaInterface::class, $this->sourceMeta->getFormMeta()); | ||||
|     } | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user