Completed
Push — master ( 269a50...019c60 )
by Tobias
04:32
created

FlashMessageTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 11
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 3
dl 11
loc 11
c 0
b 0
f 0
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
/*
4
 * This file is part of the PHP Translation package.
5
 *
6
 * (c) PHP Translation team <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Translation\Extractor\Tests\Functional\Visitor\Php\Symfony;
13
14
use Translation\Extractor\Tests\Functional\Visitor\Php\BasePHPVisitorTest;
15
use Translation\Extractor\Tests\Resources;
16
use Translation\Extractor\Visitor\Php\Symfony\FlashMessage;
17
18
/**
19
 * @author Tobias Nyholm <[email protected]>
20
 */
21
final class FlashMessageTest extends BasePHPVisitorTest
22
{
23
    public function testExtract()
24
    {
25
        $collection = $this->getSourceLocations(new FlashMessage(), Resources\Php\Symfony\FlashMessage::class);
26
27
        $this->assertCount(1, $collection);
28
        $source = $collection->first();
29
        $this->assertEquals('flash.created', $source->getMessage());
30
    }
31
}
32