Passed
Push — master ( e1ded7...51c993 )
by Gabriel
03:12 queued 11s
created

TransportManagerTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
c 1
b 0
f 0
dl 0
loc 18
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A test_transport_returnDefaultDriver() 0 7 1
A test_createSendgridTransport() 0 7 1
1
<?php
2
3
namespace Nip\Mail\Tests;
4
5
use Mockery\Mock;
6
use Nip\Mail\Transport\SendgridTransport;
7
use Nip\Mail\TransportManager;
8
9
/**
10
 * Class TransportManagerTest
11
 * @package Nip\Mail\Tests
12
 */
13
class TransportManagerTest extends AbstractTest
14
{
15
    public function test_transport_returnDefaultDriver()
16
    {
17
        /** @var TransportManager|Mock $manager */
18
        $manager = \Mockery::mock(TransportManager::class)->shouldAllowMockingProtectedMethods()->makePartial();
19
        $manager->shouldReceive('resolve')->with('smtp')->once()->andReturn(true);
20
21
        self::assertSame($manager->transport(), $manager->transport());
22
    }
23
24
    public function test_createSendgridTransport()
25
    {
26
        $manager = new TransportManager();
27
        $this->loadConfiguration();
28
29
        $sendgrid = $manager->transport('sendgrid');
30
        self::assertInstanceOf(SendgridTransport::class, $sendgrid);
31
    }
32
}
33