Completed
Push — develop ( a9d829...037456 )
by Jens
04:55 queued 43s
created

EsiHelperTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 78.57 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 1
c 1
b 0
f 1
lcom 1
cbo 3
dl 11
loc 14
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
 * @author @jayS-de <[email protected]>
4
 */
5
6
7
namespace JaySDe\HandlebarsBundle\Tests\Helper;
8
9
use JaySDe\HandlebarsBundle\Helper\EsiHelper;
10
11
class EsiHelperTest extends \PHPUnit_Framework_TestCase
12
{
13
    public function testFragmentRenderer()
14
    {
15
        $observer = $this->prophesize('\Symfony\Component\HttpKernel\Fragment\FragmentHandler');
16
        $observer->render('test', 'esi', [])->willReturn('test')->shouldBeCalled();
17
18
        $helper = new EsiHelper($observer->reveal());
19
        $result = $helper->handle('test', []);
20
21
        $this->assertInstanceOf('\LightnCandy\SafeString', $result);
22
        $this->assertSame('test', (string)$result);
23
    }
24
}
25