mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2026-10-30 09:12:09 +00:00
Refactored\moved Attribut folder
This commit is contained in:
1 parent
5301be7614
commit
e695aa26ea
122 files changed
+223
-223
No files matched your search
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Unit\Attribut;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use App\Attribut\IdAttribut;
|
||||
use App\Attribut\IdAttributInterface;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
*/
|
||||
class IdAttributTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* @var IdAttributInterface
|
||||
*/
|
||||
protected $id;
|
||||
|
||||
public function setUp(): void
|
||||
{
|
||||
$this->id = new class() implements IdAttributInterface {
|
||||
use IdAttribut;
|
||||
};
|
||||
}
|
||||
|
||||
public function testConstruct(): void
|
||||
{
|
||||
$this->assertFalse($this->id->hasId());
|
||||
$this->expectException(\TypeError::class);
|
||||
$this->id->getId();
|
||||
}
|
||||
|
||||
public function testAccessors(): void
|
||||
{
|
||||
$id = 1234;
|
||||
$this->assertNull($this->id->setId($id));
|
||||
$this->assertEquals($id, $this->id->getId());
|
||||
$this->assertTrue($this->id->hasId());
|
||||
$this->assertNull($this->id->setId(0));
|
||||
$this->assertTrue($this->id->hasId());
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user