Conditions | 1 |
Paths | 1 |
Total Lines | 32 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
26 | public function testCanConstructNearByParserFunctionDefinition() { |
||
27 | |||
28 | $instance = new ParserFunctionFactory(); |
||
29 | |||
30 | list( $name, $definition, $flag ) = $instance->newNearbyParserFunctionDefinition(); |
||
|
|||
31 | |||
32 | $this->assertEquals( |
||
33 | 'nearby', |
||
34 | $name |
||
35 | ); |
||
36 | |||
37 | $this->assertInstanceOf( |
||
38 | '\Closure', |
||
39 | $definition |
||
40 | ); |
||
41 | |||
42 | $parserOutput = $this->getMockBuilder( '\ParserOutput' ) |
||
43 | ->disableOriginalConstructor() |
||
44 | ->getMock(); |
||
45 | |||
46 | $parser = $this->getMockBuilder( '\Parser' ) |
||
47 | ->disableOriginalConstructor() |
||
48 | ->getMock(); |
||
49 | |||
50 | $parser->expects( $this->any() ) |
||
51 | ->method( 'getOutput' ) |
||
52 | ->will( $this->returnValue( $parserOutput ) ); |
||
53 | |||
54 | $this->assertNotEmpty( |
||
55 | call_user_func_array( $definition, array( $parser ) ) |
||
56 | ); |
||
57 | } |
||
58 | |||
60 |
This checks looks for assignemnts to variables using the
list(...)
function, where not all assigned variables are subsequently used.Consider the following code example.
Only the variables
$a
and$c
are used. There was no need to assign$b
.Instead, the list call could have been.