2018-11-23 21:30:25 +01:00
|
|
|
<?php
|
|
|
|
|
2019-01-20 10:41:58 +01:00
|
|
|
namespace Tests\Unit\Attribut;
|
2018-11-23 21:30:25 +01:00
|
|
|
|
|
|
|
use PHPUnit\Framework\TestCase;
|
2019-01-20 10:41:58 +01:00
|
|
|
use App\Attribut\TextAttributInterface;
|
|
|
|
use App\Attribut\TextAttribut;
|
2018-11-23 21:30:25 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @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());
|
|
|
|
}
|
|
|
|
}
|