Die Tests hatten nicht die richtige Darstellung von negativen Werten getestet.

This commit is contained in:
2021-04-15 11:34:04 +02:00
parent 0bd8932fa1
commit 735b195c06
+37 -15
View File
@@ -17,13 +17,15 @@ class WorkingHoursViewTest extends Unit
*/
public function workingHoursProvider(): array
{
$date = new DateTime('2020-11-30');
$work_days = 15;
$total_hours = new DateInterval("PT32H22M");
$overtime = new DateInterval("PT22M");
$absence_time = clone $overtime;
$absence_time->invert = 1;
return [
[
new DateTime('2020-11-30'),
PeriodDesignationEnum::WEEKLY(),
15,
new DateInterval("PT32H22M"),
new DateInterval("PT22M"),
$date, PeriodDesignationEnum::WEEKLY(), $work_days, $total_hours, $overtime,
[
'period' => '2020#49',
'periodDesignation' => 'weekly',
@@ -33,11 +35,17 @@ class WorkingHoursViewTest extends Unit
],
],
[
new DateTime('2020-11-30'),
PeriodDesignationEnum::MONTHLY(),
15,
new DateInterval("PT32H22M"),
new DateInterval("PT22M"),
$date, PeriodDesignationEnum::WEEKLY(), $work_days, $total_hours, $absence_time,
[
'period' => '2020#49',
'periodDesignation' => 'weekly',
'workingDays' => 15,
'totalHours' => '32:22:00',
'overtime' => '-00:22:00'
],
],
[
$date, PeriodDesignationEnum::MONTHLY(), $work_days, $total_hours, $overtime,
[
'period' => '2020-11',
'periodDesignation' => 'monthly',
@@ -47,12 +55,17 @@ class WorkingHoursViewTest extends Unit
],
],
[
new DateTime('2020-11-30'),
PeriodDesignationEnum::YEARLY(),
15,
new DateInterval("PT32H22M"),
new DateInterval("PT22M"),
$date, PeriodDesignationEnum::MONTHLY(), $work_days, $total_hours, $absence_time,
[
'period' => '2020-11',
'periodDesignation' => 'monthly',
'workingDays' => 15,
'totalHours' => '32:22:00',
'overtime' => '-00:22:00'
],
],
[
$date, PeriodDesignationEnum::YEARLY(), $work_days, $total_hours, $overtime, [
'period' => '2020',
'periodDesignation' => 'yearly',
'workingDays' => 15,
@@ -60,6 +73,15 @@ class WorkingHoursViewTest extends Unit
'overtime' => '00:22:00'
],
],
[
$date, PeriodDesignationEnum::YEARLY(), $work_days, $total_hours, $absence_time, [
'period' => '2020',
'periodDesignation' => 'yearly',
'workingDays' => 15,
'totalHours' => '32:22:00',
'overtime' => '-00:22:00'
],
],
];
}