mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2025-01-10 14:27:28 +01:00
39 lines
841 B
PHP
39 lines
841 B
PHP
|
<?php
|
||
|
|
||
|
namespace Tests\Entity\Attribut;
|
||
|
|
||
|
use PHPUnit\Framework\TestCase;
|
||
|
use App\Entity\Attribut\SlugAttributInterface;
|
||
|
use App\Entity\Attribut\SlugAttribut;
|
||
|
|
||
|
/**
|
||
|
* @author kevinfrantz
|
||
|
*/
|
||
|
class SlugAttributTest extends TestCase
|
||
|
{
|
||
|
/**
|
||
|
* @var SlugAttributInterface
|
||
|
*/
|
||
|
protected $slugAttribut;
|
||
|
|
||
|
public function setUp(): void
|
||
|
{
|
||
|
$this->slugAttribut = new class() implements SlugAttributInterface {
|
||
|
use SlugAttribut;
|
||
|
};
|
||
|
}
|
||
|
|
||
|
public function testConstructor(): void
|
||
|
{
|
||
|
$this->expectException(\TypeError::class);
|
||
|
$this->slugAttribut->getSlug();
|
||
|
}
|
||
|
|
||
|
public function testAccessors(): void
|
||
|
{
|
||
|
$slug = 'goodslug';
|
||
|
$this->assertNull($this->slugAttribut->setSlug($slug));
|
||
|
$this->assertEquals($slug, $this->slugAttribut->getSlug());
|
||
|
}
|
||
|
}
|