public function testArrayAccess()
 {
     $app = $this->getApp();
     $globalDebug = $this->getExtension()->config['debug'];
     $formConfig = $this->formConfig();
     $postData = $this->formData();
     $formData = new FormData($postData);
     $emailconfig = new EmailConfig($globalDebug, $formConfig, $formData);
     $this->assertNull($emailconfig->offsetSet('debug', true));
     $this->assertNull($emailconfig->offsetExists('debug'));
     $this->assertNull($emailconfig->offsetUnset('debug'));
     $this->assertSame('Gawain Lynch', $emailconfig->offsetGet('from_name'));
 }
Ejemplo n.º 2
0
 /**
  * Send a notification
  *
  * @param EmailConfig $emailConfig
  */
 private function emailSend(EmailConfig $emailConfig)
 {
     if ($this->app['mailer']->send($this->message)) {
         $this->app['logger.system']->info("Sent Bolt Forms notification to {$emailConfig->getToName()} <{$emailConfig->getToEmail()}>", array('event' => 'extensions'));
     } else {
         $this->app['logger.system']->error("Failed Bolt Forms notification to {$emailConfig->getToName()} <{$emailConfig->getToEmail()}>", array('event' => 'extensions'));
     }
 }