public function notifyAvailabilityScheduleChange(AvailabilitySchedule $schedule) { $user = $schedule->getUser(); $supervisors = $user->getSupervisors(); foreach ($supervisors as $supervisor) { $context = array('user' => $user, 'schedulePeriod' => $schedule->getSchedulePeriod(), 'supervisor' => $supervisor); $this->dispatchMessage('OpenSkedgeBundle:Mailer:availschedulechange.txt.twig', $context, $this->parameters['senderEmail'], $supervisor->getEmail()); } }
/** * Run tests to ensure the output is correct for set/getSchedulePeriod * * @return void */ public function testSchedulePeriod() { $schedulePeriod = $this->getMock('\\OpenSkedge\\AppBundle\\Entity\\SchedulePeriod'); $availSchedule = new AvailabilitySchedule(); $availSchedule->setSchedulePeriod($schedulePeriod); $this->assertInstanceOf('\\OpenSkedge\\AppBundle\\Entity\\SchedulePeriod', $availSchedule->getSchedulePeriod()); }