mirror of
https://github.com/Karaka-Management/oms-HumanResourceManagement.git
synced 2026-01-11 20:28:40 +00:00
45 lines
1.2 KiB
PHP
Executable File
45 lines
1.2 KiB
PHP
Executable File
<?php
|
|
/**
|
|
* Karaka
|
|
*
|
|
* PHP Version 8.1
|
|
*
|
|
* @package tests
|
|
* @copyright Dennis Eichhorn
|
|
* @license OMS License 2.0
|
|
* @version 1.0.0
|
|
* @link https://jingga.app
|
|
*/
|
|
declare(strict_types=1);
|
|
|
|
namespace Modules\HumanResourceManagement\tests\Models;
|
|
|
|
use Modules\HumanResourceManagement\Models\Employee;
|
|
use Modules\HumanResourceManagement\Models\EmployeeHistory;
|
|
use Modules\HumanResourceManagement\Models\EmployeeHistoryMapper;
|
|
use Modules\Profile\Models\ProfileMapper;
|
|
|
|
/**
|
|
* @internal
|
|
*/
|
|
final class EmployeeHistoryMapperTest extends \PHPUnit\Framework\TestCase
|
|
{
|
|
/**
|
|
* @covers Modules\HumanResourceManagement\Models\EmployeeHistoryMapper
|
|
* @group module
|
|
*/
|
|
public function testCRUD() : void
|
|
{
|
|
$employee = new Employee(ProfileMapper::get()->where('id', 1)->execute());
|
|
|
|
$history = new EmployeeHistory($employee);
|
|
|
|
$id = EmployeeHistoryMapper::create()->execute($history);
|
|
self::assertGreaterThan(0, $history->id);
|
|
self::assertEquals($id, $history->id);
|
|
|
|
$historyR = EmployeeHistoryMapper::get()->where('id', $history->id)->execute();
|
|
self::assertEquals($history->employee->id, $historyR->employee->id);
|
|
}
|
|
}
|