Completed
Push — master ( 7c00aa...d8aae5 )
by Ivannis Suárez
19:41
created

FromClassNameResolverTests   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 3
dl 16
loc 16
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A testResolve() 10 10 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
 * This file is part of the Cubiche package.
4
 *
5
 * Copyright (c) Cubiche
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
namespace Cubiche\Core\Bus\Tests\Units\Middlewares\Handler\Resolver\NameOfMessage;
12
13
use Cubiche\Core\Bus\Middlewares\Handler\Resolver\NameOfMessage\FromClassNameResolver;
14
use Cubiche\Core\Bus\Tests\Fixtures\Message\LoginUserMessage;
15
use Cubiche\Core\Bus\Tests\Units\TestCase;
16
17
/**
18
 * FromClassNameResolver class.
19
 *
20
 * Generated by TestGenerator on 2016-04-07 at 15:40:41.
21
 */
22 View Code Duplication
class FromClassNameResolverTests extends TestCase
0 ignored issues
show
Duplication introduced by
This class 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...
23
{
24
    /**
25
     * Test Resolve method.
26
     */
27
    public function testResolve()
28
    {
29
        $this
30
            ->given($resolver = new FromClassNameResolver())
31
            ->when($result = $resolver->resolve(new LoginUserMessage('[email protected]', 'plainpassword')))
0 ignored issues
show
Unused Code introduced by
The call to LoginUserMessage::__construct() has too many arguments starting with 'plainpassword'.

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
32
            ->then()
33
                ->string($result)
34
                    ->isEqualTo(LoginUserMessage::class)
35
        ;
36
    }
37
}
38