Test Failed
Push — master ( 0bcdd3...57f332 )
by Simon
01:11
created

SilRouteSecurityBundleTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
wmc 1
c 1
b 1
f 0
dl 0
loc 12
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A testBuild() 0 10 1
1
<?php
2
3
namespace Sil\RouteSecurityBundle\Tests;
4
5
use PHPUnit\Framework\TestCase;
6
use Sil\RouteSecurityBundle\DependencyInjection\Compiler\DynamicServiceCompilerPass;
7
use Sil\RouteSecurityBundle\SilRouteSecurityBundle;
8
use Symfony\Component\DependencyInjection\ContainerBuilder;
9
10
class SilRouteSecurityBundleTest extends TestCase
11
{
12
    public function testBuild()
13
    {
14
        $containerBuilder = $this->createMock(ContainerBuilder::class);
15
        $containerBuilder
16
            ->expects($this->once())
17
            ->method('addCompilerPass')
18
            ->with($this->isInstanceOf(DynamicServiceCompilerPass::class))
19
        ;
20
        $silRouteSecurityBundle = new SilRouteSecurityBundle();
21
        $this->assertNull($silRouteSecurityBundle->build($containerBuilder));
0 ignored issues
show
Bug introduced by
Are you sure the usage of $silRouteSecurityBundle->build($containerBuilder) targeting Sil\RouteSecurityBundle\...SecurityBundle::build() seems to always return null.

This check looks for function or method calls that always return null and whose return value is used.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
if ($a->getObject()) {

The method getObject() can return nothing but null, so it makes no sense to use the return value.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
22
    }
23
}
24