Completed
Push — master ( 0e466a...c81f6c )
by mw
06:27
created

TemplateBuilderTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 22
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testCanConstruct() 0 7 1
A tesBuild() 0 10 1
1
<?php
2
3
namespace SRF\Tests\Outline;
4
5
use SRF\Outline\TemplateBuilder;
6
7
/**
8
 * @covers \SRF\Outline\TemplateBuilder
9
 * @group semantic-result-formats
10
 *
11
 * @license GNU GPL v2+
12
 * @since 3.1
13
 *
14
 * @author mwjames
15
 */
16
class TemplateBuilderTest extends \PHPUnit_Framework_TestCase {
17
18
	public function testCanConstruct() {
19
20
		$this->assertInstanceOf(
21
			TemplateBuilder::class,
22
			new TemplateBuilder( [] )
23
		);
24
	}
25
26
	public function tesBuild() {
27
28
		$params = [
29
			'outlineproperties' => [ 'Foo' ],
30
			'template' => 'Bar',
31
			'userparam' => ''
32
		];
33
34
		$instance = new TemplateBuilder( $params );
0 ignored issues
show
Unused Code introduced by
$instance is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
35
	}
36
37
}
38