1 | <?php |
||
15 | class ConnectorTest extends \PHPUnit_Framework_TestCase |
||
16 | { |
||
17 | /** |
||
18 | * @test |
||
19 | */ |
||
20 | public function constructor() |
||
24 | |||
25 | /** |
||
26 | * @test |
||
27 | */ |
||
28 | public function constructorWithClient() |
||
33 | |||
34 | /** |
||
35 | * @test |
||
36 | * @expectedException Exception |
||
37 | */ |
||
38 | public function getBinary() |
||
44 | |||
45 | /** |
||
46 | * @test |
||
47 | * @throws \Communibase\Exception |
||
48 | */ |
||
49 | public function getByRefNeedsCorrectKeysInRef() |
||
55 | |||
56 | /** |
||
57 | * @return array |
||
58 | */ |
||
59 | public function isIdProvider() |
||
71 | |||
72 | /** |
||
73 | * @dataProvider isIdProvider |
||
74 | * @test |
||
75 | * @param $id |
||
76 | * @param $isValid |
||
77 | */ |
||
78 | public function isIdValid($id, $isValid) |
||
82 | |||
83 | /** |
||
84 | * @test |
||
85 | * @throws \Communibase\Exception |
||
86 | */ |
||
87 | public function getByIdsWithEmptyArrayReturnsArray() { |
||
92 | |||
93 | |||
94 | /** |
||
95 | * @test |
||
96 | * @depends isIdValid |
||
97 | */ |
||
98 | public function generateId() |
||
104 | |||
105 | /** |
||
106 | * Create a new HttpClient (as a mock) |
||
107 | * The responses can be injected thus easily reusable |
||
108 | * |
||
109 | * @see http://docs.guzzlephp.org/en/latest/testing.html |
||
110 | * |
||
111 | * @param array $responses |
||
112 | * |
||
113 | * @return Client |
||
114 | */ |
||
115 | private function getHttpClient(array $responses = []) |
||
123 | } |
||
124 |
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.