mirror of
https://github.com/Karaka-Management/oms-HumanResourceManagement.git
synced 2026-01-24 17:58:40 +00:00
fix tests
This commit is contained in:
parent
0233863aa1
commit
9dae632c56
|
|
@ -219,6 +219,7 @@ final class BackendController extends Controller
|
|||
->where('unit', $this->app->unitId)
|
||||
->executeGetArray();
|
||||
|
||||
/** @var \Modules\HumanResourceManagement\Models\EmployeeHistory[] $histories */
|
||||
$histories = EmployeeHistoryMapper::getAll()
|
||||
->where('department', \array_map(function (Department $department) : int { return $department->id; }, $view->data['departments']))
|
||||
->where('unit', $this->app->unitId)
|
||||
|
|
@ -360,6 +361,7 @@ final class BackendController extends Controller
|
|||
->where('department', \array_map(function (Department $department) : int { return $department->id; }, $departments))
|
||||
->executeGetArray();
|
||||
|
||||
/** @var \Modules\HumanResourceManagement\Models\EmployeeHistory[] $histories */
|
||||
$histories = EmployeeHistoryMapper::getAll()
|
||||
->where('department', \array_map(function (Department $department) : int { return $department->id; }, $departments))
|
||||
->where('position', \array_map(function (Position $position) : int { return $position->id; }, $view->data['positions']))
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase
|
|||
*/
|
||||
protected ModuleAbstract $module;
|
||||
|
||||
protected static int $employee = 0;
|
||||
protected static mixed $employee = 0;
|
||||
|
||||
public static function setUpBeforeClass() : void
|
||||
{
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ declare(strict_types=1);
|
|||
namespace Modules\HumanResourceManagement\tests\Models;
|
||||
|
||||
use Modules\HumanResourceManagement\Models\EmployeeHistory;
|
||||
use Modules\HumanResourceManagement\Models\NullEmployee;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
|
|
@ -47,7 +48,7 @@ final class EmployeeHistoryTest extends \PHPUnit\Framework\TestCase
|
|||
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||
public function testSerialize() : void
|
||||
{
|
||||
$this->history->employee = 2;
|
||||
$this->history->employee = new NullEmployee(2);
|
||||
|
||||
$serialized = $this->history->jsonSerialize();
|
||||
unset($serialized['start']);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user