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

WebAdminUserHelperFactoryTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 100 %

Coupling/Cohesion

Components 1
Dependencies 5

Importance

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

How to fix   Duplicated Code   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

1
<?php
2
3
declare(strict_types=1);
4
5
namespace Admin\Test\Factory\View\Helper;
6
7
class WebAdminUserHelperFactoryTest extends \PHPUnit_Framework_TestCase
8
{
9
    public function testInvokingWebUserHelperShouldReturnWebAdminUserHelper()
10
    {
11
        $adminUserService = $this->getMockBuilder(\Admin\Service\AdminUserService::class)
12
            ->disableOriginalConstructor()
13
            ->getMockForAbstractClass();
14
        $container = $this->getMockBuilder(\Interop\Container\ContainerInterface::class)
15
            ->setMethods(['get'])
16
            ->getMockForAbstractClass();
17
        $container->expects(static::at(0))
18
            ->method('get')
19
            ->will(static::returnValue($adminUserService));
20
        $webUserHelperFactory = new \Admin\Factory\View\Helper\WebAdminUserHelperFactory();
21
        static::assertInstanceOf(\Admin\View\Helper\WebAdminUserHelper::class, $webUserHelperFactory($container, 'test'));
22
    }
23
}
24