Conditions | 1 |
Paths | 1 |
Total Lines | 32 |
Code Lines | 21 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
18 | public function testCreateService() |
||
19 | { |
||
20 | $locator = $this->prophesize(ContainerInterface::class); |
||
21 | $locator->get('Configuration')->willReturn( |
||
22 | [ |
||
23 | 'mt_mail' => [ |
||
24 | 'transport_options' => [ |
||
25 | 'host' => 'some-host.com', |
||
26 | 'connection_class' => 'login', |
||
27 | 'connection_config' => [ |
||
28 | 'username' => 'user', |
||
29 | 'password' => 'pass', |
||
30 | 'ssl' => 'tls', |
||
31 | ], |
||
32 | ], |
||
33 | ], |
||
34 | ] |
||
35 | ); |
||
36 | $factory = new SmtpTransportFactory(); |
||
37 | $service = $factory($locator->reveal()); |
||
38 | $this->assertInstanceOf(Smtp::class, $service); |
||
39 | $this->assertEquals('some-host.com', $service->getOptions()->getHost()); |
||
40 | $this->assertEquals('login', $service->getOptions()->getConnectionClass()); |
||
41 | $this->assertEquals( |
||
42 | [ |
||
43 | 'username' => 'user', |
||
44 | 'password' => 'pass', |
||
45 | 'ssl' => 'tls', |
||
46 | ], |
||
47 | $service->getOptions()->getConnectionConfig() |
||
48 | ); |
||
49 | } |
||
50 | } |
||
51 |