Passed
Branch master (bb3df7)
by Theo
01:32
created

EventSpec::it_is_initializable()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Tests\CalendarBundle\Entity;
4
5
use PhpSpec\ObjectBehavior;
6
use CalendarBundle\Entity\Event;
7
8
class EventSpec extends ObjectBehavior
9
{
10
    private $title = 'Title';
11
    private $start;
12
    private $end = null;
13
    private $options = [];
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->options = ['textColor' => 'blue'];
20
21
        $this->beAnInstanceOf(Event::class);
22
        $this->beConstructedWith($this->title, $this->start, $this->end, $this->options);
23
    }
24
25
    public function it_is_initializable()
26
    {
27
        $this->shouldHaveType(Event::class);
28
    }
29
30
    public function it_has_require_values()
31
    {
32
        $this->getTitle()->shouldReturn($this->title);
0 ignored issues
show
Bug introduced by
The method getTitle() does not exist on Tests\CalendarBundle\Entity\EventSpec. 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
               getTitle()->shouldReturn($this->title);
Loading history...
33
        $this->getStart()->shouldReturn($this->start);
0 ignored issues
show
Bug introduced by
The method getStart() does not exist on Tests\CalendarBundle\Entity\EventSpec. 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
               getStart()->shouldReturn($this->start);
Loading history...
34
        $this->getEnd()->shouldReturn($this->end);
0 ignored issues
show
Bug introduced by
The method getEnd() does not exist on Tests\CalendarBundle\Entity\EventSpec. 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
               getEnd()->shouldReturn($this->end);
Loading history...
35
        $this->getOptions()->shouldReturn($this->options);
0 ignored issues
show
Bug introduced by
The method getOptions() does not exist on Tests\CalendarBundle\Entity\EventSpec. 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

35
        $this->/** @scrutinizer ignore-call */ 
36
               getOptions()->shouldReturn($this->options);
Loading history...
36
    }
37
38
    public function it_should_convert_its_values_in_to_array()
39
    {
40
        $url = 'url';
41
        $urlValue = 'www.url.com';
42
43
        $options = [
44
            $url => $urlValue,
45
        ];
46
47
        $allDay = false;
48
49
        $this->setAllDay($allDay);
0 ignored issues
show
Bug introduced by
The method setAllDay() does not exist on Tests\CalendarBundle\Entity\EventSpec. 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

49
        $this->/** @scrutinizer ignore-call */ 
50
               setAllDay($allDay);
Loading history...
50
51
        $this->addOption('be-removed', 'value');
0 ignored issues
show
Bug introduced by
The method addOption() does not exist on Tests\CalendarBundle\Entity\EventSpec. 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

51
        $this->/** @scrutinizer ignore-call */ 
52
               addOption('be-removed', 'value');
Loading history...
52
        $this->removeOption('be-removed');
0 ignored issues
show
Bug introduced by
The method removeOption() does not exist on Tests\CalendarBundle\Entity\EventSpec. 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

52
        $this->/** @scrutinizer ignore-call */ 
53
               removeOption('be-removed');
Loading history...
53
54
        $this->removeOption('no-found-key')->shouldReturn(null);
55
56
        $this->setOptions($options);
0 ignored issues
show
Bug introduced by
The method setOptions() does not exist on Tests\CalendarBundle\Entity\EventSpec. 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

56
        $this->/** @scrutinizer ignore-call */ 
57
               setOptions($options);
Loading history...
57
        $this->getOptions()->shouldReturn($options);
58
59
        $this->getOption($url, $urlValue)->shouldReturn($urlValue);
0 ignored issues
show
Bug introduced by
The method getOption() does not exist on Tests\CalendarBundle\Entity\EventSpec. 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

59
        $this->/** @scrutinizer ignore-call */ 
60
               getOption($url, $urlValue)->shouldReturn($urlValue);
Loading history...
60
61
        $this->toArray()->shouldReturn(
0 ignored issues
show
Bug introduced by
The method toArray() does not exist on Tests\CalendarBundle\Entity\EventSpec. 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

61
        $this->/** @scrutinizer ignore-call */ 
62
               toArray()->shouldReturn(
Loading history...
62
            [
63
                'title' => $this->title,
64
                'start' => $this->start->format('Y-m-d\\TH:i:sP'),
65
                'allDay' => $allDay,
66
                'end' => $this->end->format('Y-m-d\\TH:i:sP'),
67
                $url => $urlValue,
68
            ]
69
        );
70
    }
71
}
72