Passed
Pull Request — master (#20)
by
unknown
07:25
created

VariablesTest::testGetDateTime()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 5
rs 9.4285
cc 1
eloc 3
nc 1
nop 0
1
<?php namespace VojtaSvoboda\Reservations\Tests\Variables;
2
3
use PluginTestCase;
4
use VojtaSvoboda\Reservations\Classes\Variables;
5
use VojtaSvoboda\Reservations\Models\Settings;
6
7
class VariablesTest extends PluginTestCase
8
{
9
    public function testGetDateTime()
10
    {
11
        $result = Variables::getDateTimeFormat();
12
        $this->assertSame('d/m/Y H:i', $result);
13
    }
14
15
    public function testGetReservationLength()
16
    {
17
        $result = Variables::getReservationLength();
18
        $this->assertSame('2 hours', $result);
19
    }
20
21
    public function testGetReservationLengthAfterSet()
22
    {
23
        Settings::set('reservation_length', 90);
24
        Settings::set('reservation_length_unit', 'minutes');
25
        $result = Variables::getReservationLength();
26
        $this->assertSame('90 minutes', $result);
27
    }
28
}
29