mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2025-09-13 13:57:10 +02:00
Optimized for SPA
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Unit\Entity\Source\Complex\Collection;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use App\Entity\Source\Complex\Collection\CollectionSourceInterface;
|
||||
use App\Entity\Source\Complex\Collection\AbstractCollectionSource;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
|
||||
class AbstractCollectionSourceTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* @var CollectionSourceInterface
|
||||
*/
|
||||
public $collectionSource;
|
||||
|
||||
public function setUp(): void
|
||||
{
|
||||
$this->collectionSource = new class() extends AbstractCollectionSource {
|
||||
};
|
||||
}
|
||||
|
||||
public function testConstruct(): void
|
||||
{
|
||||
$this->assertInstanceOf(Collection::class, $this->collectionSource->getCollection());
|
||||
}
|
||||
}
|
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Unit\Entity\Source\Complex\Collection;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use App\Entity\Source\Complex\Collection\TreeCollectionSourceInterface;
|
||||
use App\Entity\Source\Complex\Collection\TreeCollectionSource;
|
||||
use App\Entity\Source\PureSource;
|
||||
|
||||
/**
|
||||
* @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);
|
||||
}
|
||||
|
||||
public function testAccessors()
|
||||
{
|
||||
$member = new PureSource();
|
||||
$this->tree->setCollection(new ArrayCollection([
|
||||
$member,
|
||||
]));
|
||||
$this->assertEquals($member, $this->tree->getCollection()
|
||||
->get(0));
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user