MissedBookingEmailNotificationHandlerFactoryTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
B testFactoryProcessesWithoutErrors() 0 25 1
1
<?php
2
3
namespace JhFlexiTimeTest\NotificationHandler\Factory;
4
5
use JhFlexiTime\NotificationHandler\Factory\MissedBookingEmailNotificationHandlerFactory;
6
use JhHubBase\Options\ModuleOptions;
7
use PHPUnit_Framework_TestCase;
8
9
/**
10
 * Class MissedBookingEmailNotificationHandlerFactoryTest
11
 * @package JhFlexiTime\NotificationHandler\Factory
12
 * @author  Aydin Hassan <[email protected]>
13
 */
14
class MissedBookingEmailNotificationHandlerFactoryTest extends PHPUnit_Framework_TestCase
15
{
16
    public function testFactoryProcessesWithoutErrors()
17
    {
18
        $serviceLocator   = $this->getMock('Zend\ServiceManager\ServiceLocatorInterface');
19
        $services         = [
20
            'AcMailer\Service\MailService'      => $this->getMock('AcMailer\Service\MailServiceInterface'),
21
            'JhHubBase\Options\ModuleOptions'   => new ModuleOptions
22
        ];
23
24
        $serviceLocator
25
            ->expects($this->any())
26
            ->method('get')
27
            ->will(
28
                $this->returnCallback(
29
                    function ($serviceName) use ($services) {
30
                        return $services[$serviceName];
31
                    }
32
                )
33
            );
34
35
        $factory = new MissedBookingEmailNotificationHandlerFactory();
36
        $this->assertInstanceOf(
37
            'JhFlexiTime\NotificationHandler\MissedBookingEmailNotificationHandler',
38
            $factory->createService($serviceLocator)
39
        );
40
    }
41
}
42