Solved unit tests

This commit is contained in:
Kevin Frantz
2018-11-15 20:30:34 +01:00
parent de66375ee0
commit 7be76cac0d
14 changed files with 41 additions and 59 deletions

View File

@@ -3,13 +3,13 @@
namespace tests\unit\Entity\Source\Data;
use PHPUnit\Framework\TestCase;
use App\Entity\Source\Data\NameSourceInterface;
use App\Entity\Source\Data\NameSource;
use App\Entity\Source\Data\Name\NameSourceInterface;
use App\Entity\Source\Data\Name\AbstractNameSource;
/**
* @author kevinfrantz
*/
class NameSourceTest extends TestCase
class AbstractNameSourceTest extends TestCase
{
/**
* @var NameSourceInterface
@@ -18,7 +18,8 @@ class NameSourceTest extends TestCase
public function setUp(): void
{
$this->nameSource = new NameSource();
$this->nameSource = new class() extends AbstractNameSource {
};
}
public function testConstructor(): void

View File

@@ -1,33 +0,0 @@
<?php
namespace tests\unit\Entity\Source\Data;
use PHPUnit\Framework\TestCase;
use App\Entity\Source\Data\PersonIdentitySourceInterface;
use App\Entity\Source\Data\PersonIdentitySource;
use App\Entity\Source\Combination\FullPersonNameSourceInterface;
class PersonIdentitySourceTest extends TestCase
{
/**
* @var PersonIdentitySourceInterface
*/
protected $identity;
public function setUp(): void
{
$this->identity = new PersonIdentitySource();
}
public function testConstructor(): void
{
$this->assertInstanceOf(FullPersonNameSourceInterface::class, $this->identity->getName());
}
public function testFullName(): void
{
$name = $this->createMock(FullPersonNameSourceInterface::class);
$this->assertNull($this->identity->setName($name));
$this->assertEquals($name, $this->identity->getName());
}
}