Optimized for SPA

This commit is contained in:
Kevin Frantz
2019-01-05 23:52:37 +01:00
parent 9e685260e9
commit bccd6efaff
393 changed files with 253 additions and 37 deletions

View File

@@ -0,0 +1,38 @@
<?php
namespace tests\unit\Entity\Source\Primitive;
use PHPUnit\Framework\TestCase;
use App\Entity\Source\Primitive\Name\NameSourceInterface;
use App\Entity\Source\Primitive\Name\AbstractNameSource;
/**
* @author kevinfrantz
*/
class AbstractNameSourceTest extends TestCase
{
/**
* @var NameSourceInterface
*/
protected $nameSource;
public function setUp(): void
{
$this->nameSource = new class() extends AbstractNameSource {
};
}
public function testConstructor(): void
{
$this->assertInstanceOf(NameSourceInterface::class, $this->nameSource);
$this->expectException(\TypeError::class);
$this->nameSource->getName();
}
public function testName(): void
{
$name = 'Hello World!';
$this->nameSource->setName($name);
$this->assertEquals($name, $this->nameSource->getName());
}
}

View File

@@ -0,0 +1,26 @@
<?php
namespace Tests\Unit\Entity\Source\Primitive\Text;
use PHPUnit\Framework\TestCase;
use App\Entity\Source\Primitive\Text\TextSourceInterface;
use App\Entity\Source\Primitive\Text\TextSource;
class TextSourceTest extends TestCase
{
/**
* @var TextSourceInterface
*/
protected $textSource;
public function setUp(): void
{
$this->textSource = new TextSource();
}
public function testConstructor(): void
{
$this->expectException(\TypeError::class);
$this->textSource->getText();
}
}