mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-05 14:25:00 +00:00
fix Entity/UserTest and phpstan error
This commit is contained in:
@@ -38,15 +38,13 @@ class UserTest extends TestCase
|
||||
self::assertSame($scopeB, $user->getMainScope());
|
||||
|
||||
// 2. get scopeA history, check endDate is not null
|
||||
$histories = $user->getMainScopeHistories();
|
||||
$scopeHistoryA = null;
|
||||
foreach ($histories as $row) {
|
||||
/** @var User\UserScopeHistory $row */
|
||||
if ($scopeA === $row->getScope()) {
|
||||
$scopeHistoryA = $row;
|
||||
}
|
||||
}
|
||||
self::assertNotNull($scopeHistoryA->getEndDate());
|
||||
self::assertNotNull(
|
||||
$user
|
||||
->getMainScopeHistories()
|
||||
->filter(fn (User\UserScopeHistory $userScopeHistory) => $userScopeHistory->getScope() === $scopeA )
|
||||
->first()->getEndDate()
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
public function testUserJobHistory()
|
||||
@@ -62,15 +60,12 @@ class UserTest extends TestCase
|
||||
self::assertSame($jobB, $user->getUserJob());
|
||||
|
||||
// 2. get jobA history, check endDate is not null
|
||||
$histories = $user->getUserJobHistories();
|
||||
$jobHistoryA = null;
|
||||
foreach ($histories as $row) {
|
||||
/** @var User\UserJobHistory $row */
|
||||
if ($jobA === $row->getJob()) {
|
||||
$jobHistoryA = $row;
|
||||
}
|
||||
}
|
||||
self::assertNotNull($jobHistoryA->getEndDate());
|
||||
self::assertNotNull(
|
||||
$user
|
||||
->getUserJobHistories()
|
||||
->filter(fn(User\UserJobHistory $userJobHistory) => $userJobHistory->getJob() === $jobA )
|
||||
->first()->getEndDate()
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user