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

VideoHelperTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 5

Importance

Changes 0
Metric Value
dl 0
loc 24
rs 10
c 0
b 0
f 0
wmc 2
lcom 1
cbo 5

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testInvokingAdminUserHelperShouldReturnItSelf() 0 8 1
A testGetLatestShouldReturnArray() 0 12 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Article\Test\View\Helper;
6
7
class VideoHelperTest extends \PHPUnit_Framework_TestCase
8
{
9
    public function testInvokingAdminUserHelperShouldReturnItSelf()
10
    {
11
        $videoService = $this->getMockBuilder('Article\Service\VideoService')
12
            ->disableOriginalConstructor()
13
            ->getMockForAbstractClass();
14
        $videoHelper = new \Article\View\Helper\VideoHelper($videoService);
15
        static::assertInstanceOf(\Article\View\Helper\VideoHelper::class, $videoHelper());
16
    }
17
18
    public function testGetLatestShouldReturnArray()
19
    {
20
        $videoService = $this->getMockBuilder('Article\Service\VideoService')
21
            ->setMethods(['fetchLatest'])
22
            ->disableOriginalConstructor()
23
            ->getMockForAbstractClass();
24
        $videoService->expects(static::once())
25
            ->method('fetchLatest')
26
            ->willReturn([]);
27
        $videoHelper = new \Article\View\Helper\VideoHelper($videoService);
28
        static::assertSame([], $videoHelper->getLatest());
29
    }
30
}
31