Ejemplo n.º 1
0
 /**
  * @param array $data
  * @param SchoolInterface $entity
  */
 protected function assertDataEquals(array $data, $entity)
 {
     // `school_id`,`template_prefix`,`title`,`ilios_administrator_email`,`change_alert_recipients`
     $this->assertEquals($data[0], $entity->getId());
     $this->assertEquals($data[1], $entity->getTemplatePrefix());
     $this->assertEquals($data[2], $entity->getTitle());
     $this->assertEquals($data[3], $entity->getIliosAdministratorEmail());
     $this->assertEquals($data[4], $entity->getChangeAlertRecipients());
 }
Ejemplo n.º 2
0
 /**
  * Locates the applicable message template for a given school and returns its path.
  * @param SchoolInterface $school
  * @return string The template path.
  */
 protected function getTemplatePath(SchoolInterface $school)
 {
     $paths = ['@custom_email_templates/' . basename($school->getTemplatePrefix() . '_' . self::DEFAULT_TEMPLATE_NAME), '@custom_email_templates/' . self::DEFAULT_TEMPLATE_NAME];
     foreach ($paths as $path) {
         if ($this->templatingEngine->exists($path)) {
             return $path;
         }
     }
     return 'IliosCoreBundle:Email:' . self::DEFAULT_TEMPLATE_NAME;
 }