mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2025-09-13 21:57:16 +02:00
Optimized unit tests for new data structure
This commit is contained in:
36
application/tests/Unit/Entity/Source/Data/NameSourceTest.php
Normal file
36
application/tests/Unit/Entity/Source/Data/NameSourceTest.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace tests\unit\Entity\Source\Data;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use App\Entity\Source\Data\NameSourceInterface;
|
||||
use App\Entity\Source\Data\NameSource;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
*/
|
||||
class NameSourceTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* @var NameSourceInterface
|
||||
*/
|
||||
protected $nameSource;
|
||||
|
||||
public function setUp(): void
|
||||
{
|
||||
$this->nameSource = new NameSource();
|
||||
}
|
||||
|
||||
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());
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user