Passed
Pull Request — master (#9)
by Pavel
12:36
created

SecurityControllerTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 37
Duplicated Lines 64.86 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 80%

Importance

Changes 0
Metric Value
dl 24
loc 37
c 0
b 0
f 0
wmc 3
lcom 1
cbo 2
ccs 16
cts 20
cp 0.8
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A testPublicAction() 12 12 1
A testPrivateAction() 12 12 1
A getKernelClass() 0 4 1

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
namespace Bankiru\Api\Rpc\Test\Tests;
4
5
use Bankiru\Api\Rpc\Test\Kernel;
6
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
7
8
final class SecurityControllerTest extends WebTestCase
9
{
10 1 View Code Duplication
    public function testPublicAction()
1 ignored issue
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
11
    {
12 1
        $client = self::createClient();
13
14 1
        $client->request(
15 1
            'POST',
16 1
            '/test/',
17 1
            ['method' => 'security/public']
18 1
        );
19
20 1
        self::assertTrue($client->getResponse()->isSuccessful());
21 1
    }
22
23
    /**
24
     * @expectedException \Symfony\Component\Security\Core\Exception\InsufficientAuthenticationException
25
     * @expectedExceptionMessage Full authentication is required to access this resource.
26
     */
27 1 View Code Duplication
    public function testPrivateAction()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
28
    {
29 1
        $client = self::createClient();
30
31 1
        $client->request(
32 1
            'POST',
33 1
            '/test/',
34 1
            ['method' => 'security/private']
35 1
        );
36
37
        self::assertTrue($client->getResponse()->isSuccessful());
38
    }
39
40
    protected static function getKernelClass()
41
    {
42
        return Kernel::class;
43
    }
44
}
45