Passed
Branch master (bb3df7)
by Theo
01:32
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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A let() 0 8 1
A it_handle_events() 0 5 1
A it_is_initializable() 0 3 1
A it_has_require_values() 0 5 1
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);
0 ignored issues
show
Bug introduced by
The method getStart() does not exist on Tests\CalendarBundle\Event\CalendarEventSpec. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

32
        $this->/** @scrutinizer ignore-call */ 
33
               getStart()->shouldReturn($this->start);
Loading history...
33
        $this->getEnd()->shouldReturn($this->end);
0 ignored issues
show
Bug introduced by
The method getEnd() does not exist on Tests\CalendarBundle\Event\CalendarEventSpec. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

33
        $this->/** @scrutinizer ignore-call */ 
34
               getEnd()->shouldReturn($this->end);
Loading history...
34
        $this->getFilters()->shouldReturn($this->filters);
0 ignored issues
show
Bug introduced by
The method getFilters() does not exist on Tests\CalendarBundle\Event\CalendarEventSpec. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

34
        $this->/** @scrutinizer ignore-call */ 
35
               getFilters()->shouldReturn($this->filters);
Loading history...
35
    }
36
37
    public function it_handle_events(
38
        Event $event
39
    ) {
40
        $this->addEvent($event);
0 ignored issues
show
Bug introduced by
The method addEvent() does not exist on Tests\CalendarBundle\Event\CalendarEventSpec. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

40
        $this->/** @scrutinizer ignore-call */ 
41
               addEvent($event);
Loading history...
41
        $this->getEvents()->shouldReturn([$event]);
0 ignored issues
show
Bug introduced by
The method getEvents() does not exist on Tests\CalendarBundle\Event\CalendarEventSpec. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

41
        $this->/** @scrutinizer ignore-call */ 
42
               getEvents()->shouldReturn([$event]);
Loading history...
42
    }
43
}
44