Test Failed
Branch master (193490)
by Theo
04:08
created

CalendarEventSpec   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 15
dl 0
loc 33
rs 10
c 0
b 0
f 0
wmc 4
1
<?php
2
3
namespace Tests\CalendarBundle\Event;
4
5
use PhpSpec\ObjectBehavior;
6
use CalendarBundle\Event\CalendarEvent;
7
use CalendarBundle\Entity\Event;
8
9
class CalendarEventSpec extends ObjectBehavior
10
{
11
    private $start;
12
    private $end;
13
    private $filters;
14
15
    public function let()
16
    {
17
        $this->start = new \DateTime('2019-03-18 08:41:31');
18
        $this->end = new \DateTime('2019-03-18 08:41:31');
19
        $this->filters = [];
20
21
        $this->beAnInstanceOf(CalendarEvent::class);
22
        $this->beConstructedWith($this->start, $this->end, $this->filters);
23
    }
24
25
    public function it_is_initializable()
26
    {
27
        $this->shouldHaveType(CalendarEvent::class);
28
    }
29
30
    public function it_has_require_values()
31
    {
32
        $this->getStart()->shouldReturn($this->start);
33
        $this->getEnd()->shouldReturn($this->end);
34
        $this->getFilters()->shouldReturn($this->filters);
35
    }
36
37
    public function it_handle_events(
38
        Event $event
39
    ) {
40
        $this->addEvent($event);
41
        $this->getEvents()->shouldReturn([$event]);
42
    }
43
}
44