Completed
Push — master ( c2d471...c0413d )
by Aleksandar
208:47 queued 204:29
created

EventHelperTest::testAllShouldReturnArray()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 10
nc 1
nop 0
dl 0
loc 12
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Article\Test\View\Helper;
6
7
class EventHelperTest extends \PHPUnit_Framework_TestCase
8
{
9
    public function testInvokingAdminUserHelperShouldReturnItSelf()
10
    {
11
        $eventService = $this->getMockBuilder('Article\Service\EventService')
12
            ->disableOriginalConstructor()
13
            ->getMockForAbstractClass();
14
        $eventHelper = new \Article\View\Helper\EventHelper($eventService);
15
        static::assertInstanceOf(\Article\View\Helper\EventHelper::class, $eventHelper());
16
    }
17
18
    public function testAllShouldReturnArray()
19
    {
20
        $eventService = $this->getMockBuilder('Article\Service\EventService')
21
            ->setMethods(['fetchLatest'])
22
            ->disableOriginalConstructor()
23
            ->getMockForAbstractClass();
24
        $eventService->expects(static::once())
25
            ->method('fetchLatest')
26
            ->willReturn([]);
27
        $eventHelper = new \Article\View\Helper\EventHelper($eventService);
28
        static::assertSame([], $eventHelper->getLatest());
29
    }
30
}
31