Passed
Push — master ( 134f11...d02ad4 )
by Alexander
08:37
created

TestTransport::isStarted()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 1
b 0
f 0
1
<?php
2
3
namespace Yiisoft\Mailer\SwiftMailer\Tests;
4
5
class TestTransport extends \Swift_Transport_EsmtpTransport
6
{
7
    /**
8
     * @var Swift_Events_EventListener[] $plugins
9
     */
10
    public $plugins;
11
12
    public function __construct()
13
    {
14
        call_user_func_array(
15
            [$this, 'Swift_Transport_EsmtpTransport::__construct'],
16
            \Swift_DependencyContainer::getInstance()->createDependenciesFor('transport.smtp')
17
        );
18
    }
19
20
    public function registerPlugin(\Swift_Events_EventListener $plugin)
21
    {
22
        $this->plugins[] = $plugin;
23
        parent::registerPlugin($plugin);
24
    }
25
26
    protected function getBufferParams()
27
    {
28
        return [];
29
    }
30
31
    public function send(\Swift_Mime_SimpleMessage $message, &$failedRecipients = null)
32
    {
33
        if (empty($message->getSubject())) {
34
            throw new \Swift_RfcComplianceException('Subject is required');
35
        }
36
37
        return 1;
38
    }
39
40
    public function isStarted()
41
    {
42
        return true;
43
    }
44
}
45