mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2025-09-13 13:57:10 +02:00
Added tests for has- functions
This commit is contained in:
@@ -6,6 +6,9 @@ use PHPUnit\Framework\TestCase;
|
||||
use App\Entity\Attribut\IdAttribut;
|
||||
use App\Entity\Attribut\IdAttributInterface;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
*/
|
||||
class IdAttributTest extends TestCase
|
||||
{
|
||||
/**
|
||||
@@ -22,6 +25,7 @@ class IdAttributTest extends TestCase
|
||||
|
||||
public function testConstruct(): void
|
||||
{
|
||||
$this->assertFalse($this->id->hasId());
|
||||
$this->expectException(\TypeError::class);
|
||||
$this->id->getId();
|
||||
}
|
||||
@@ -31,5 +35,8 @@ class IdAttributTest extends TestCase
|
||||
$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