Implemented collection attribut for abstract source collection and tests

This commit is contained in:
Kevin Frantz 2018-11-02 20:37:23 +01:00
parent cbb8bc702c
commit b11b53884b
3 changed files with 32 additions and 2 deletions

View File

@ -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;
}

View File

@ -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
{
}

View File

@ -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();
}
}