Completed
Push — master ( 300b23...237d9e )
by Gorka
03:49
created

DateTimeSpec::it_is_initializable()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
/*
4
 * This file is part of the Kreta package.
5
 *
6
 * (c) Beñat Espiña <[email protected]>
7
 * (c) Gorka Laucirica <[email protected]>
8
 *
9
 * For the full copyright and license information, please view the LICENSE
10
 * file that was distributed with this source code.
11
 */
12
13
namespace Spec\Kreta\SharedKernel\Domain\Model;
14
15
use Kreta\SharedKernel\Domain\Model\DateTime;
16
use PhpSpec\ObjectBehavior;
17
18
class DateTimeSpec extends ObjectBehavior
19
{
20
    function it_is_initializable()
21
    {
22
        $this->shouldHaveType(DateTime::class);
23
    }
24
25
    function it_builds_now()
26
    {
27
        $this->beConstructedNow();
28
        $this->shouldHaveType(\DateTimeImmutable::class);
29
    }
30
31
    function it_builds_from_time()
32
    {
33
        $this->beConstructedFromTime('2016-10-11');
34
        $this->shouldHaveType(\DateTimeImmutable::class);
35
    }
36
37
    function it_builds_from_relative()
38
    {
39
        $this->beConstructedFromRelative('+7 days');
40
        $this->shouldHaveType(\DateTimeImmutable::class);
41
    }
42
}
43