Completed
Branch master (4042af)
by Aleksandar
02:14
created

AdminUserHelperFactoryTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 6

Importance

Changes 0
Metric Value
dl 0
loc 21
rs 10
c 0
b 0
f 0
wmc 1
lcom 1
cbo 6
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Admin\Test\Factory\View\Helper;
6
7
class AdminUserHelperFactoryTest extends \PHPUnit_Framework_TestCase
8
{
9
    public function testInvokingAdminUserHelperShouldReturnAdminUserService()
10
    {
11
        $session = new \Zend\Session\SessionManager();
12
        $adminUserService = $this->getMockBuilder(\Admin\Service\AdminUserService::class)
13
            ->disableOriginalConstructor()
14
            ->getMockForAbstractClass();
15
        $container = $this->getMockBuilder(\Interop\Container\ContainerInterface::class)
16
            ->setMethods(['get'])
17
            ->getMockForAbstractClass();
18
        $container->expects(static::at(0))
19
            ->method('get')
20
            ->will(static::returnValue($session));
21
        $container->expects(static::at(1))
22
            ->method('get')
23
            ->will(static::returnValue($adminUserService));
24
        $adminUserHelperFactory = new \Admin\Factory\View\Helper\AdminUserHelperFactory();
25
        static::assertInstanceOf(\Admin\View\Helper\AdminUserHelper::class, $adminUserHelperFactory($container, 'test'));
26
    }
27
}
28