Added Text source

This commit is contained in:
Kevin Frantz
2018-11-23 21:30:25 +01:00
parent 0ca2838ae2
commit 4066634af2
7 changed files with 129 additions and 1 deletions

View File

@@ -0,0 +1,38 @@
<?php
namespace Tests\Unit\Entity\Attribut;
use PHPUnit\Framework\TestCase;
use App\Entity\Attribut\TextAttributInterface;
use App\Entity\Attribut\TextAttribut;
/**
* @author kevinfrantz
*/
class TextAttributTest extends TestCase
{
/**
* @var TextAttributInterface
*/
protected $textAttribut;
public function setUp(): void
{
$this->textAttribut = new class() implements TextAttributInterface {
use TextAttribut;
};
}
public function testConstructor(): void
{
$this->expectException(\TypeError::class);
$this->textAttribut->getText();
}
public function testAccessors(): void
{
$text = 'Hello World!';
$this->assertNull($this->textAttribut->setText($text));
$this->assertEquals($text, $this->textAttribut->getText());
}
}