fix tests

This commit is contained in:
Dennis Eichhorn 2024-04-25 13:34:46 +00:00
parent 0233863aa1
commit 9dae632c56
3 changed files with 5 additions and 2 deletions

View File

@ -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']))

View File

@ -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
{

View File

@ -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']);