FileTransportFactoryTest::testCreateService()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 16
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 16
rs 9.4285
cc 1
eloc 9
nc 1
nop 0
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