2019-11-27 23:43:21 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Engelsystem\Test\Unit\Models\Shifts;
|
|
|
|
|
|
|
|
use Engelsystem\Models\Shifts\Schedule;
|
|
|
|
use Engelsystem\Models\Shifts\ScheduleShift;
|
2020-05-11 19:57:25 +02:00
|
|
|
use Engelsystem\Test\Unit\Models\ModelTest;
|
2019-11-27 23:43:21 +01:00
|
|
|
|
2020-05-11 19:57:25 +02:00
|
|
|
class ScheduleTest extends ModelTest
|
2019-11-27 23:43:21 +01:00
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @covers \Engelsystem\Models\Shifts\Schedule::scheduleShifts
|
|
|
|
*/
|
|
|
|
public function testScheduleShifts()
|
|
|
|
{
|
|
|
|
$schedule = new Schedule(['url' => 'https://foo.bar/schedule.xml']);
|
|
|
|
$schedule->save();
|
|
|
|
|
|
|
|
(new ScheduleShift(['shift_id' => 1, 'schedule_id' => $schedule->id, 'guid' => 'a']))->save();
|
|
|
|
(new ScheduleShift(['shift_id' => 2, 'schedule_id' => $schedule->id, 'guid' => 'b']))->save();
|
|
|
|
(new ScheduleShift(['shift_id' => 3, 'schedule_id' => $schedule->id, 'guid' => 'c']))->save();
|
|
|
|
|
|
|
|
$this->assertCount(3, $schedule->scheduleShifts);
|
|
|
|
}
|
|
|
|
}
|