mirror of
				https://github.com/kevinveenbirkenbach/infinito.git
				synced 2025-11-04 03:07:58 +00:00 
			
		
		
		
	Implemented Collection Attribut
This commit is contained in:
		@@ -0,0 +1,36 @@
 | 
			
		||||
<?php
 | 
			
		||||
 | 
			
		||||
namespace Tests\Unit\Entity\Attribut;
 | 
			
		||||
 | 
			
		||||
use PHPUnit\Framework\TestCase;
 | 
			
		||||
use App\Entity\Attribut\CollectionAttributInterface;
 | 
			
		||||
use App\Entity\Attribut\CollectionAttribut;
 | 
			
		||||
use Doctrine\Common\Collections\ArrayCollection;
 | 
			
		||||
 | 
			
		||||
class CollectionAttributTest extends TestCase
 | 
			
		||||
{
 | 
			
		||||
    /**
 | 
			
		||||
     * @var CollectionAttributInterface
 | 
			
		||||
     */
 | 
			
		||||
    protected $collection;
 | 
			
		||||
 | 
			
		||||
    public function setUp(): void
 | 
			
		||||
    {
 | 
			
		||||
        $this->collection = new class() implements CollectionAttributInterface {
 | 
			
		||||
            use CollectionAttribut;
 | 
			
		||||
        };
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function testConstructor(): void
 | 
			
		||||
    {
 | 
			
		||||
        $this->expectException(\TypeError::class);
 | 
			
		||||
        $this->collection->getCollection();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function testAccessors(): void
 | 
			
		||||
    {
 | 
			
		||||
        $collection = new ArrayCollection();
 | 
			
		||||
        $this->assertNull($this->collection->setCollection($collection));
 | 
			
		||||
        $this->assertEquals($collection, $this->collection->getCollection());
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user