public function testCanAddNewSchedule() { $layoutId = 87; $name = 'new dude'; $isDefault = false; $weekdayStart = 2; $daysVisible = 5; $scheduleIdOfSourceLayout = 981; $schedule = new Schedule(null, $name, $isDefault, $weekdayStart, $daysVisible, null, $layoutId); $expectedGetScheduleById = new GetScheduleByIdCommand($scheduleIdOfSourceLayout); $fakeSchedules = new FakeScheduleRepository(); $this->db->SetRows(array($fakeSchedules->GetRow(9, null, true, 0, 0, null, $layoutId))); $expectedInsertScheduleCommand = new AddScheduleCommand($name, $isDefault, $weekdayStart, $daysVisible, $layoutId); $this->scheduleRepository->Add($schedule, $scheduleIdOfSourceLayout); $this->assertTrue($this->db->ContainsCommand($expectedGetScheduleById)); $this->assertTrue($this->db->ContainsCommand($expectedInsertScheduleCommand)); }