mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2025-01-09 14:07:25 +01:00
Implemented test for name attribut
This commit is contained in:
parent
f2868d9259
commit
03ce3f5cdf
30
application/tests/Unit/Entity/Attribut/NameAttributTest.php
Normal file
30
application/tests/Unit/Entity/Attribut/NameAttributTest.php
Normal file
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
namespace App\Entity\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());
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user