testAnyOtherDayReturnsNothingWithBooking()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace JhFlexiTimeTest\View\Helper;
4
5
use JhFlexiTime\View\Helper\BookingClasses;
6
7
/**
8
 * Class BookingClassesTest
9
 * @package JhFlexiTimeTest\View\Helper
10
 * @author Aydin Hassan <[email protected]>
11
 */
12
class BookingClassesTest extends \PHPUnit_Framework_TestCase
13
{
14
    protected $helper;
15
16
    public function setUp()
17
    {
18
        $this->helper = new BookingClasses();
19
    }
20
21
    public function testTodayReturnsCurrentDayClassWithBooking()
22
    {
23
        $this->assertEquals('today', $this->helper->__invoke(new \DateTime("today"), true));
24
    }
25
26
    public function testAnyOtherDayReturnsNothingWithBooking()
27
    {
28
        $this->assertEquals('', $this->helper->__invoke(new \DateTime("yesterday"), true));
29
    }
30
31
    public function testTodayReturnsCurrentDayClassAndNoBooking()
32
    {
33
        $this->assertEquals('today no-booking', $this->helper->__invoke(new \DateTime("today"), false));
34
    }
35
36
    public function testPreviousDayReturnsNoPastBooking()
37
    {
38
        $this->assertEquals('no-booking no-booking-past', $this->helper->__invoke(new \DateTime("yesterday"), false));
39
    }
40
41
    public function testFutureDayReturnsNoFutureBooking()
42
    {
43
        $this->assertEquals('no-booking no-booking-future', $this->helper->__invoke(new \DateTime("tomorrow"), false));
44
    }
45
}
46