/** * Remove schedule from db * * @return void */ public function delete() { $this->model->removeSchedule($this->schedule); }
/** * @param Schedule $schedule * * @return bool */ public function deleteSchedule(Schedule $schedule) { $this->model->removeSchedule($schedule); return true; }
/** * Test remove schedule */ public function testDeleteSchedule() { $scheduleDocument = $this->getMockObject('Litvinab\\Bundle\\CronEventBundle\\Document\\Schedule'); $repository = $this->getMockObject('Litvinab\\Bundle\\CronEventBundle\\Repository\\ScheduleRepository', ['remove']); $model = new ScheduleModel($repository); $model->deleteSchedule($scheduleDocument); $this->assertTrue(true); }