mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2025-09-13 13:57:10 +02:00
Optimized for SPA
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
<?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());
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user