1 | <?php |
||
8 | class UriTest extends \PHPUnit_Framework_TestCase |
||
9 | { |
||
10 | protected $uri; |
||
11 | |||
12 | public function __construct() |
||
16 | |||
17 | /** |
||
18 | * @test |
||
19 | * |
||
20 | * Test that it gets the scheme properly |
||
21 | */ |
||
22 | public function it_gets_the_proper_scheme() |
||
27 | |||
28 | /** |
||
29 | * @test |
||
30 | * |
||
31 | * Test that it returns the Uri as a string |
||
32 | */ |
||
33 | public function it_returns_the_uri_as_a_string() |
||
40 | |||
41 | /** |
||
42 | * @test |
||
43 | * |
||
44 | * Test that it returns a new instance of the Uri with the specified fragment |
||
45 | */ |
||
46 | public function it_returns_the_specified_uri_fragment() |
||
60 | |||
61 | /** |
||
62 | * @test |
||
63 | * |
||
64 | * Test that it returns the specified query string |
||
65 | */ |
||
66 | public function it_returns_the_specified_query_string() |
||
80 | |||
81 | /** |
||
82 | * @test |
||
83 | * |
||
84 | * Test that it validates the query string |
||
85 | */ |
||
86 | public function it_validates_the_query_string() |
||
108 | |||
109 | |||
110 | // path validity |
||
111 | // withpath() |
||
112 | // withHost() |
||
113 | // withPort() |
||
114 | // |
||
115 | } |
||
116 |
This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.
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.