Refactored code through substituting by PureSource

This commit is contained in:
Kevin Frantz
2019-01-04 22:09:05 +01:00
parent 74c404a9ce
commit f931f824fb
11 changed files with 34 additions and 74 deletions

View File

@@ -6,9 +6,9 @@ use PHPUnit\Framework\TestCase;
use App\Entity\Source\SourceInterface;
use App\Entity\Meta\LawInterface;
use Doctrine\Common\Collections\Collection;
use App\Entity\Source\AbstractSource;
use App\Entity\EntityInterface;
use App\Entity\Meta\Relation\Parent\CreatorRelationInterface;
use App\Entity\Source\PureSource;
/**
* @author kevinfrantz
@@ -20,15 +20,9 @@ class AbstractSourceTest extends TestCase
*/
protected $source;
private function getSourceDummy(): SourceInterface
{
return new class() extends AbstractSource {
};
}
public function setUp()
{
$this->source = $this->getSourceDummy();
$this->source = new PureSource();
}
public function testConstructor(): void

View File

@@ -5,9 +5,9 @@ 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\AbstractSource;
use App\Entity\Source\Complex\Collection\TreeCollectionSourceInterface;
use App\Entity\Source\Complex\Collection\TreeCollectionSource;
use App\Entity\Source\PureSource;
/**
* @author kevinfrantz
@@ -32,8 +32,7 @@ class TreeCollectionSourceTest extends TestCase
public function testAccessors()
{
$member = new class() extends AbstractSource {
};
$member = new PureSource();
$this->tree->setCollection(new ArrayCollection([
$member,
]));

View File

@@ -8,6 +8,9 @@ use App\Entity\Source\PureSource;
use App\Entity\Source\AbstractSource;
use PHPUnit\Framework\TestCase;
/**
* @author kevinfrantz
*/
class PureSourceTest extends TestCase
{
/**