Completed
Push — master ( 57eaae...d53a99 )
by Simone
03:18 queued 01:22
created

RulerTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 47
Duplicated Lines 55.32 %

Coupling/Cohesion

Components 1
Dependencies 4

Importance

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

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 sensorario/resources repository
5
 *
6
 * (c) Simone Gentili <[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 Sensorario\Resources\Test\Resources;
13
14
use PHPUnit\Framework\TestCase;
15
use Sensorario\Resources\Configurator;
16
use Sensorario\Resources\Container;
17
use Sensorario\Resources\Resource;
18
use Sensorario\Resources\Rulers\Ruler;
19
20
class RulerTest extends TestCase
21
{
22
    /**
23
     * @expectedException \Sensorario\Resources\Exceptions\UndefinedResourceException
24
     * @expectedExceptionMessage Oops! Cant get rule without resource
25
     */
26
    public function testCantGetRuleWithoutRecource()
27
    {
28
        $ruler = new Ruler();
29
        $ruler->getRuleFromResource();
30
    }
31
}
32