Ejemplo n.º 1
0
 /**
  * Test get all schedules
  */
 public function testGetAllSchedules()
 {
     $scheduleDocument = $this->getMockObject('Litvinab\\Bundle\\CronEventBundle\\Document\\Schedule');
     $repository = $this->getMockObject('Litvinab\\Bundle\\CronEventBundle\\Repository\\ScheduleRepository', ['findAll']);
     $this->setMockMethodsReturnValue($repository, ['findAll'], [$scheduleDocument]);
     $model = new ScheduleModel($repository);
     $result = $model->getAllSchedules();
     $this->assertCount(1, $result);
     $this->assertContains($scheduleDocument, $result);
 }
Ejemplo n.º 2
0
 /**
  * Get all schedules
  *
  * @return Schedule[]
  */
 public function getSchedules()
 {
     return $this->model->getAllSchedules();
 }