Completed
Push — master ( fce8e6...b0acfe )
by GBProd
02:14
created

HasFinishedProvidingTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

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

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 Tests\GBProd\ElasticsearchDataProviderBundle\Event;
4
5
use GBProd\ElasticsearchDataProviderBundle\Event\HasFinishedProviding;
6
use GBProd\ElasticsearchDataProviderBundle\DataProvider\RegistryEntry;
7
8
/**
9
 * Tests for HasFinishedProviding
10
 * 
11
 * @author gbprod <[email protected]>
12
 */
13
class HasFinishedProvidingTest extends \PHPUnit_Framework_TestCase
14
{
15
    public function testConstruction()
16
    {
17
        $entry = $this
18
            ->getMockBuilder(RegistryEntry::class)
19
            ->disableOriginalConstructor()
20
            ->getMock()
21
        ;
22
        
23
        $testedInstance = new HasFinishedProviding($entry);
24
        
25
        $this->assertEquals(
26
            $entry,
27
            $testedInstance->getEntry()
28
        );
29
    }
30
}
31