Example #1
0
 /**
  * Returns full path to log dir
  *
  * @param string $dir
  * @return string
  */
 private function getLogDirPath()
 {
     $dir = $this->options->getLogDir();
     if (!is_dir($dir)) {
         $this->uMask = umask(0);
         mkdir($dir, 0777, true);
     }
     return $dir;
 }
Example #2
0
 public function testConfigSetProperly()
 {
     $configArray = array('mail_test_mode' => true, 'mail_send_from' => '*****@*****.**', 'mail_send_from_name' => 'Sender Name', 'add_root_bcc' => true, 'root_email' => '*****@*****.**', 'transport_class' => 'Some\\Namespace\\TransportClass', 'transport_options' => array('option1' => 1, 'option2' => 2), 'log_dir' => 'path/to/sample/dir', 'base_uri' => 'http://example.com');
     $options = new ModuleOptions($configArray);
     $this->assertEquals($configArray, $options->toArray());
     $this->assertSame($configArray['mail_test_mode'], $options->getMailTestMode());
     $this->assertSame($configArray['mail_send_from'], $options->getMailSendFrom());
     $this->assertSame($configArray['mail_send_from_name'], $options->getMailSendFromName());
     $this->assertSame($configArray['add_root_bcc'], $options->getAddRootBcc());
     $this->assertSame($configArray['root_email'], $options->getRootEmail());
     $this->assertSame($configArray['transport_class'], $options->getTransportClass());
     $this->assertSame($configArray['transport_options'], $options->getTransportOptions());
     $this->assertSame($configArray['log_dir'], $options->getLogDir());
     $this->assertSame($configArray['base_uri'], $options->getBaseUri());
 }