mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2025-01-10 22:37:28 +01:00
46 lines
1.2 KiB
PHP
46 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace Tests\Unit\Entity\Source\Collection;
|
|
|
|
use PHPUnit\Framework\TestCase;
|
|
use Doctrine\Common\Collections\Collection;
|
|
use Doctrine\Common\Collections\ArrayCollection;
|
|
use App\Entity\Source\AbstractSource;
|
|
use App\Entity\Source\Collection\TreeCollectionSourceInterface;
|
|
use App\Entity\Source\Collection\TreeCollectionSource;
|
|
use App\Helper\DimensionHelperInterface;
|
|
|
|
/**
|
|
* @author kevinfrantz
|
|
*/
|
|
class TreeCollectionSourceTest extends TestCase
|
|
{
|
|
/**
|
|
* @var TreeCollectionSourceInterface
|
|
*/
|
|
protected $tree;
|
|
|
|
public function setUp(): void
|
|
{
|
|
$this->tree = new TreeCollectionSource();
|
|
}
|
|
|
|
public function testConstructor(): void
|
|
{
|
|
$this->assertInstanceOf(Collection::class, $this->tree->getCollection());
|
|
$this->assertInstanceOf(TreeCollectionSourceInterface::class, $this->tree);
|
|
$this->assertInstanceOf(DimensionHelperInterface::class, $this->tree);
|
|
}
|
|
|
|
public function testAccessors()
|
|
{
|
|
$member = new class() extends AbstractSource {
|
|
};
|
|
$this->tree->setCollection(new ArrayCollection([
|
|
$member,
|
|
]));
|
|
$this->assertEquals($member, $this->tree->getCollection()
|
|
->get(0));
|
|
}
|
|
}
|