mirror of
				https://github.com/kevinveenbirkenbach/infinito.git
				synced 2025-10-31 01:09:41 +00:00 
			
		
		
		
	Implemented collection attribut for abstract source collection and tests
This commit is contained in:
		| @@ -3,12 +3,14 @@ | ||||
| namespace App\Entity\Source\Collection; | ||||
|  | ||||
| use App\Entity\Source\AbstractSource; | ||||
| use App\Entity\Attribut\CollectionAttribut; | ||||
|  | ||||
| /** | ||||
|  * @todo Implement inhiering classes! | ||||
|  * | ||||
|  * @author kevinfrantz | ||||
|  */ | ||||
| class AbstractCollectionSource extends AbstractSource implements CollectionSourceInterface | ||||
| abstract class AbstractCollectionSource extends AbstractSource implements CollectionSourceInterface | ||||
| { | ||||
|     use CollectionAttribut; | ||||
| } | ||||
|   | ||||
| @@ -3,7 +3,8 @@ | ||||
| namespace App\Entity\Source\Collection; | ||||
|  | ||||
| use App\Entity\Source\SourceInterface; | ||||
| use App\Entity\Attribut\CollectionAttributInterface; | ||||
|  | ||||
| interface CollectionSourceInterface extends SourceInterface | ||||
| interface CollectionSourceInterface extends SourceInterface, CollectionAttributInterface | ||||
| { | ||||
| } | ||||
|   | ||||
| @@ -0,0 +1,27 @@ | ||||
| <?php | ||||
|  | ||||
| namespace Tests\Unit\Entity\Source\Collection; | ||||
|  | ||||
| use PHPUnit\Framework\TestCase; | ||||
| use App\Entity\Source\Collection\CollectionSourceInterface; | ||||
| use App\Entity\Source\Collection\AbstractCollectionSource; | ||||
|  | ||||
| class AbstractCollectionSourceTest extends TestCase | ||||
| { | ||||
|     /** | ||||
|      * @var CollectionSourceInterface | ||||
|      */ | ||||
|     public $collectionSource; | ||||
|  | ||||
|     public function setUp(): void | ||||
|     { | ||||
|         $this->collectionSource = new class() extends AbstractCollectionSource { | ||||
|         }; | ||||
|     } | ||||
|  | ||||
|     public function testConstruct(): void | ||||
|     { | ||||
|         $this->expectException(\TypeError::class); | ||||
|         $this->collectionSource->getCollection(); | ||||
|     } | ||||
| } | ||||
		Reference in New Issue
	
	Block a user