mirror of
https://github.com/Karaka-Management/oms-HumanResourceManagement.git
synced 2026-01-11 12:28:39 +00:00
72 lines
2.0 KiB
PHP
72 lines
2.0 KiB
PHP
<?php
|
|
/**
|
|
* Jingga
|
|
*
|
|
* PHP Version 8.2
|
|
*
|
|
* @package tests
|
|
* @copyright Dennis Eichhorn
|
|
* @license OMS License 2.2
|
|
* @version 1.0.0
|
|
* @link https://jingga.app
|
|
*/
|
|
declare(strict_types=1);
|
|
|
|
namespace Modules\HumanResourceManagement\tests\Models;
|
|
|
|
use Modules\HumanResourceManagement\Models\EmployeeEducationHistory;
|
|
|
|
/**
|
|
* @internal
|
|
*/
|
|
#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\HumanResourceManagement\Models\EmployeeEducationHistory::class)]
|
|
final class EmployeeEducationHistoryTest extends \PHPUnit\Framework\TestCase
|
|
{
|
|
private EmployeeEducationHistory $history;
|
|
|
|
/**
|
|
* {@inheritdoc}
|
|
*/
|
|
protected function setUp() : void
|
|
{
|
|
$this->history = new EmployeeEducationHistory();
|
|
}
|
|
|
|
#[\PHPUnit\Framework\Attributes\Group('module')]
|
|
public function testDefault() : void
|
|
{
|
|
self::assertEquals(0, $this->history->id);
|
|
self::assertNull($this->history->end);
|
|
self::assertEquals(0, $this->history->employee);
|
|
self::assertEquals('', $this->history->educationTitle);
|
|
self::assertTrue($this->history->passed);
|
|
self::assertEquals('', $this->history->score);
|
|
self::assertInstanceOf('\DateTime', $this->history->start);
|
|
self::assertInstanceOf('\phpOMS\Stdlib\Base\Address', $this->history->address);
|
|
}
|
|
|
|
#[\PHPUnit\Framework\Attributes\Group('module')]
|
|
public function testSerialize() : void
|
|
{
|
|
$this->history->employee = 2;
|
|
$this->history->educationTitle = 'title';
|
|
$this->history->score = '69';
|
|
$this->history->passed = false;
|
|
|
|
$serialized = $this->history->jsonSerialize();
|
|
unset($serialized['start']);
|
|
|
|
self::assertEquals(
|
|
[
|
|
'id' => 0,
|
|
'employee' => 2,
|
|
'educationTitle' => 'title',
|
|
'passed' => false,
|
|
'score' => '69',
|
|
'end' => null,
|
|
],
|
|
$serialized
|
|
);
|
|
}
|
|
}
|