Test Failed
Push — master ( 37023c...961468 )
by Theo
01:47
created

CalendarEventTest::testItHasRequireValues()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 0
dl 0
loc 5
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace CalendarBundle\Tests\Event;
4
5
use PhpSpec\ObjectBehavior;
0 ignored issues
show
Bug introduced by
The type PhpSpec\ObjectBehavior was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
6
use CalendarBundle\Event\CalendarEvent;
7
use CalendarBundle\Entity\Event;
8
use PHPUnit\Framework\TestCase;
9
10
class CalendarEventTest extends TestCase
11
{
12
    private $start;
13
    private $end;
14
    private $filters;
15
16
    public function setUp(): void
17
    {
18
        $this->start = new \DateTime('2019-03-18 08:41:31');
19
        $this->end = new \DateTime('2019-03-18 08:41:31');
20
        $this->filters = [];
21
22
        $this->eventEntity = $this->createMock(Event::class);
0 ignored issues
show
Bug Best Practice introduced by
The property eventEntity does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
23
24
        $this->event = new CalendarEvent(
0 ignored issues
show
Bug Best Practice introduced by
The property event does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
25
            $this->start,
26
            $this->end,
27
            $this->filters
28
        );
29
    }
30
31
    public function testItHasRequireValues()
32
    {
33
        $this->assertEquals($this->start, $this->event->getStart());
34
        $this->assertEquals($this->end, $this->event->getEnd());
35
        $this->assertEquals($this->filters, $this->event->getFilters());
36
    }
37
38
    public function testItHandleEvents() {
39
        $this->event->addEvent($this->eventEntity);
40
        $this->assertEquals([$this->eventEntity], $this->event->getEvents());
41
    }
42
}
43