Completed
Push — master ( aa5a0d...109f75 )
by Peter
05:58
created

LatteTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 22
Duplicated Lines 50 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A testIfWillPassVariableToView() 11 11 1

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 Renderers;
4
5
use Maslosoft\MiniView\MiniView;
6
use Maslosoft\MiniView\Renderers\LatteRenderer;
7
use UnitTester;
8
9
class LatteTest extends \Codeception\TestCase\Test
10
{
11
12
	/**
13
	 * @var UnitTester
14
	 */
15
	protected $tester;
16
17
	// tests
18 View Code Duplication
	public function testIfWillPassVariableToView()
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...
19
	{
20
		$var = 'New Variable';
21
22
		$view = new MiniView($this);
23
		$view->setRenderer(new LatteRenderer());
24
25
		$result = $view->render('passVariable', ['var' => $var], true);
26
27
		$this->assertSame($var, $result);
28
	}
29
30
}
31