FileTransportFactoryTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
c 1
b 0
f 0
lcom 0
cbo 3
dl 0
loc 19
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A testCreateService() 0 16 1
1
<?php
2
/**
3
 * MtMail - e-mail module for Zend Framework
4
 *
5
 * @link      http://github.com/mtymek/MtMail
6
 * @copyright Copyright (c) 2013-2017 Mateusz Tymek
7
 * @license   BSD 2-Clause
8
 */
9
10
namespace MtMailTest\Factory;
11
12
use Interop\Container\ContainerInterface;
13
use MtMail\Factory\FileTransportFactory;
14
use Zend\Mail\Transport\File;
15
16
class FileTransportFactoryTest extends \PHPUnit\Framework\TestCase
17
{
18
    public function testCreateService()
19
    {
20
        $locator = $this->prophesize(ContainerInterface::class);
21
        $locator->get('Configuration')->willReturn(
22
            [
23
                'mt_mail' => [
24
                    'transport_options' => [
25
                        'path' => __DIR__, // directory must exist
26
                    ]
27
                ],
28
            ]
29
        );
30
        $factory = new FileTransportFactory();
31
        $service = $factory($locator->reveal());
32
        $this->assertInstanceOf(File::class, $service);
33
    }
34
}
35