Completed
Push — master ( 964908...9eae13 )
by Antonio
02:35
created

FixtureHelper::getPdoMailJob()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %
Metric Value
dl 0
loc 6
rs 9.4285
cc 1
eloc 3
nc 1
nop 0
1
<?php
2
namespace Da\Mailer\Test\Fixture;
3
4
use Da\Mailer\Queue\Backend\Pdo\PdoMailJob;
5
use Da\Mailer\Queue\Backend\Sqs\SqsMailJob;
6
use Da\Mailer\Model\MailMessage;
7
use Da\Mailer\Transport\TransportInterface;
8
9
class FixtureHelper
10
{
11
    public static function getMailMessage()
12
    {
13
        return new MailMessage(self::getMailMessageSmtpConfigurationArray());
14
    }
15
16
    public static function getPdoMailJob()
17
    {
18
        return new PdoMailJob([
19
            'message' => json_encode(self::getMailMessage())
20
        ]);
21
    }
22
23
    public static function getSqsMailJob()
24
    {
25
        return new SqsMailJob([
26
            'message' => json_encode(self::getMailMessage())
27
        ]);
28
    }
29
30
    public static function getMySqlConnectionConfiguration()
31
    {
32
        return [
33
            'connectionString' => 'mysql:host=localhost;dbname=mail_queue_test',
34
            'username' => 'root',
35
            'password' => '',
36
        ];
37
    }
38
39
    public static function getMailMessageSmtpConfigurationArray()
40
    {
41
        return [
42
            'transportOptions' => [],
43
            'transportType' => TransportInterface::TYPE_SMTP,
44
            'host' => '127.0.0.1',
45
            'port' => 21,
46
            'from' => '[email protected]',
47
            'to' => '[email protected]',
48
            'cc' => '[email protected]',
49
            'bcc' => '[email protected]',
50
            'subject' => 'subject',
51
            'bodyHtml' => '<b>This is body Html</b>',
52
            'bodyText' => 'This is body text',
53
            'attachments' => [ __DIR__ . '/../data/test_view.php']
54
        ];
55
    }
56
}
57