infinito/application/symfony/tests/Unit/Attribut/NameAttributTest.php
2019-02-17 14:33:19 +01:00

34 lines
682 B
PHP

<?php
namespace Infinito\Attribut;
use PHPUnit\Framework\TestCase;
class NameAttributTest extends TestCase
{
/**
* @var NameAttributInterface
*/
public $name;
public function setUp(): void
{
$this->name = new class() implements NameAttributInterface {
use NameAttribut;
};
}
public function testConstructor(): void
{
$this->expectException(\TypeError::class);
$this->name->getName();
}
public function testAccessors(): void
{
$name = 'hello world!';
$this->assertNull($this->name->setName($name));
$this->assertEquals($name, $this->name->getName());
}
}