testFindAndNotifyAction()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 21
Code Lines 14

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 21
rs 9.3142
cc 1
eloc 14
nc 1
nop 0
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