UserReminderCliControllerTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A testFindAndNotifyAction() 0 21 1
1
<?php
2
3
namespace JhFlexiTimeTest\Controller;
4
5
use JhFlexiTime\Controller\UserReminderCliController;
6
use PHPUnit_Framework_TestCase;
7
8
/**
9
 * Class UserReminderCliControllerTest
10
 * @package JhFlexiTimeTest\Controller
11
 * @author Aydin Hassan <[email protected]>
12
 */
13
class UserReminderCliControllerTest extends PHPUnit_Framework_TestCase
14
{
15
16
    public function testFindAndNotifyAction()
17
    {
18
        $service = $this->getMockBuilder('\JhFlexiTime\Service\MissingBookingReminderService')
19
            ->disableOriginalConstructor()
20
            ->getMock();
21
22
        $console = $this->getMock('Zend\Console\Adapter\AdapterInterface');
23
24
        $controller = new UserReminderCliController($service, $console);
25
26
        $console
27
            ->expects($this->once())
28
            ->method('writeLine')
29
            ->with('Finished! ', 3);
30
31
        $service
32
            ->expects($this->once())
33
            ->method('findAndNotifyMissingBookings');
34
35
        $controller->findAndNotifyMissingBookingsAction();
36
    }
37
}
38