Completed
Push — master ( 9a7fc1...319399 )
by Peter
01:58
created

testIfWillPassVariableToViewWithRendererDetection()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 6

Duplication

Lines 12
Ratio 100 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
c 1
b 1
f 0
dl 12
loc 12
rs 9.4285
cc 1
eloc 6
nc 1
nop 0
1
<?php
2
3
namespace Renderers;
4
5
use Maslosoft\MiniView\MiniView;
6
use Maslosoft\MiniView\Renderers\LatteRenderer;
7
use Maslosoft\MiniView\Renderers\PhpRenderer;
8
use UnitTester;
9
10
class LatteTest extends \Codeception\TestCase\Test
11
{
12
13
	/**
14
	 * @var UnitTester
15
	 */
16
	protected $tester;
17
18
	// tests
19 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...
20
	{
21
		$var = 'New Variable';
22
23
		$view = new MiniView($this);
24
		$view->setRenderer(new LatteRenderer());
25
26
		$result = $view->render('passVariable2', ['var' => $var], true);
27
28
		$this->assertSame($var, $result);
29
	}
30
31 View Code Duplication
	public function testIfWillPassVariableToViewWithRendererDetection()
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...
32
	{
33
		$var = 'New Variable';
34
35
		$view = new MiniView($this);
36
37
		$result = $view->render('passVariable2.latte', ['var' => $var], true);
38
39
		$this->assertInstanceOf(PhpRenderer::class, $view->getRenderer(), 'That renderer was reverted back to default renderer');
40
41
		$this->assertSame($var, $result);
42
	}
43
44
}
45