Completed
Push — master ( d068c5...99fa9d )
by Antonio
03:22 queued 58s
created

FixtureHelper   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2
Metric Value
wmc 4
lcom 0
cbo 2
dl 0
loc 41
rs 10

4 Methods

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