Jobby\Jobby::getDefaultConfig PHP Метод

getDefaultConfig() публичный Метод

public getDefaultConfig ( ) : array
Результат array
    public function getDefaultConfig()
    {
        return ['jobClass' => 'Jobby\\BackgroundJob', 'recipients' => null, 'mailer' => 'sendmail', 'maxRuntime' => null, 'smtpHost' => null, 'smtpPort' => 25, 'smtpUsername' => null, 'smtpPassword' => null, 'smtpSender' => 'jobby@' . $this->getHelper()->getHost(), 'smtpSenderName' => 'jobby', 'smtpSecurity' => null, 'runAs' => null, 'environment' => $this->getHelper()->getApplicationEnv(), 'runOnHost' => $this->getHelper()->getHost(), 'output' => null, 'dateFormat' => 'Y-m-d H:i:s', 'enabled' => true, 'haltDir' => null, 'debug' => false];
    }

Usage Example

Пример #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'] = '[email protected],[email protected]';
     $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());
 }
All Usage Examples Of Jobby\Jobby::getDefaultConfig