mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2026-10-30 09:12:09 +00:00
Optimized for SPA
This commit is contained in:
1 parent
9e685260e9
commit
bccd6efaff
393 files changed
+253
-37
No files matched your search
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
namespace tests\unit\Entity;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use App\Entity\EntityInterface;
|
||||
use App\Entity\AbstractEntity;
|
||||
|
||||
class AbstractEntityTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* @var EntityInterface
|
||||
*/
|
||||
protected $entity;
|
||||
|
||||
public function setUp(): void
|
||||
{
|
||||
$this->entity = new class() extends AbstractEntity {
|
||||
};
|
||||
}
|
||||
|
||||
public function testConstructor(): void
|
||||
{
|
||||
$this->assertEquals(0, $this->entity->getVersion());
|
||||
$this->expectException(\TypeError::class);
|
||||
$this->entity->getId();
|
||||
}
|
||||
|
||||
public function testVersion(): void
|
||||
{
|
||||
$version = 123;
|
||||
$this->assertNull($this->entity->setVersion($version));
|
||||
$this->assertEquals($version, $this->entity->getVersion());
|
||||
}
|
||||
|
||||
public function testId(): void
|
||||
{
|
||||
$id = 123;
|
||||
$this->assertNull($this->entity->setId($id));
|
||||
$this->assertEquals($id, $this->entity->getId());
|
||||
}
|
||||
|
||||
public function testToString(): void
|
||||
{
|
||||
$this->assertEquals(true, is_string($this->entity->__toString()));
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user