getDefaultConfig() public method

public getDefaultConfig ( ) : array
return array
Exemplo n.º 1
0
 /**
  * @covers ::sendMail
  * @covers ::getCurrentMailer
  */
 public function testSendMail()
 {
     $mailer = $this->getSwiftMailerMock();
     $mailer->expects($this->once())->method('send');
     $jobby = new Jobby();
     $config = $jobby->getDefaultConfig();
     $config['output'] = 'output message';
     $config['recipients'] = 'a@a.com,b@b.com';
     $helper = new Helper($mailer);
     $mail = $helper->sendMail('job', $config, 'message');
     $host = $helper->getHost();
     $email = "jobby@{$host}";
     $this->assertContains('job', $mail->getSubject());
     $this->assertContains("[{$host}]", $mail->getSubject());
     $this->assertEquals(1, count($mail->getFrom()));
     $this->assertEquals('jobby', current($mail->getFrom()));
     $this->assertEquals($email, current(array_keys($mail->getFrom())));
     $this->assertEquals($email, current(array_keys($mail->getSender())));
     $this->assertContains($config['output'], $mail->getBody());
     $this->assertContains('message', $mail->getBody());
 }
Exemplo n.º 2
0
 /**
  * @covers Jobby\Jobby::getDefaultConfig
  */
 public function testDefaultOptions()
 {
     $jobby = new Jobby();
     $opts = $jobby->getDefaultConfig();
     $this->assertNull($opts["recipients"]);
     $this->assertEquals("sendmail", $opts["mailer"]);
     $this->assertNull($opts["runAs"]);
     $this->assertNull($opts["output"]);
     $this->assertEquals("Y-m-d H:i:s", $opts["dateFormat"]);
     $this->assertTrue($opts["enabled"]);
     $this->assertFalse($opts["debug"]);
 }
Exemplo n.º 3
0
 /**
  * @covers ::getDefaultConfig
  */
 public function testDefaultConfig()
 {
     $jobby = new Jobby();
     $config = $jobby->getDefaultConfig();
     $this->assertNull($config['recipients']);
     $this->assertEquals('sendmail', $config['mailer']);
     $this->assertNull($config['runAs']);
     $this->assertNull($config['output']);
     $this->assertEquals('Y-m-d H:i:s', $config['dateFormat']);
     $this->assertTrue($config['enabled']);
     $this->assertFalse($config['debug']);
 }
Exemplo n.º 4
0
 /**
  * @covers Jobby\Helper::sendMail
  * @covers Jobby\Helper::getCurrentMailer
  */
 public function testSendMail()
 {
     $mailer = $this->getSwiftMailerMock();
     $mailer->expects($this->once())->method("send");
     $jobby = new Jobby();
     $config = $jobby->getDefaultConfig();
     $config["output"] = "output message";
     $config["recipients"] = "a@a.com,b@b.com";
     $helper = new Helper($mailer);
     $mail = $helper->sendMail("job", $config, "message");
     $host = $helper->getHost();
     $email = "jobby@{$host}";
     $this->assertContains("job", $mail->getSubject());
     $this->assertContains("[{$host}]", $mail->getSubject());
     $this->assertEquals(1, count($mail->getFrom()));
     $this->assertEquals("jobby", current($mail->getFrom()));
     $this->assertEquals($email, current(array_keys($mail->getFrom())));
     $this->assertEquals($email, current(array_keys($mail->getSender())));
     $this->assertContains($config["output"], $mail->getBody());
     $this->assertContains("message", $mail->getBody());
 }