Completed
Push — master ( c81f6c...1650a0 )
by mw
07:33
created

tests/phpunit/Unit/Outline/TemplateBuilderTest.php (1 issue)

Severity

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

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
$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