ColorsAdapterTest::testColorAdapter()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 7
Ratio 100 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 7
loc 7
rs 9.4285
cc 1
eloc 5
nc 1
nop 0
1
<?php
2
3
namespace PhpSchool\PSXTest;
4
5
use Colors\Color;
6
use PhpSchool\PSX\ColorsAdapter;
7
use PHPUnit_Framework_TestCase;
8
9
/**
10
 * Class ColorsAdapterTest
11
 * @package PhpSchool\PSXTest
12
 * @author Aydin Hassan <[email protected]>
13
 */
14
class ColorsAdapterTest extends PHPUnit_Framework_TestCase
15
{
16 View Code Duplication
    public function testColorAdapter()
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...
17
    {
18
        $color = new Color;
19
        $color->setForceStyle(true);
20
        $adapter = new ColorsAdapter($color);
21
        $this->assertSame('HELLO WORLD', $adapter->colour('HELLO WORLD', 'green'));
22
    }
23
24 View Code Duplication
    public function testStringIsReturnedAsIsIfNoStyleExists()
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...
25
    {
26
        $color = new Color;
27
        $color->setForceStyle(true);
28
        $adapter = new ColorsAdapter($color);
29
        $this->assertSame('HELLO WORLD', $adapter->colour('HELLO WORLD', 'not-a-style'));
30
    }
31
}
32