1 | <?php |
||
7 | class ResponseTest extends \PHPUnit_Framework_TestCase |
||
8 | { |
||
9 | |||
10 | /** @var Response */ |
||
11 | private $sut; |
||
12 | |||
13 | public function setUp() |
||
17 | |||
18 | public function testShouldBeInstantiated() |
||
22 | |||
23 | /** @dataProvider responses */ |
||
24 | public function testShouldReturnData($response, $status, $iso2, $iso3, $name) |
||
34 | |||
35 | public function responses() |
||
43 | |||
44 | /** |
||
45 | * @expectedException \Exception |
||
46 | * @expectedExceptionCode 1 |
||
47 | * @expectedExceptionMessage Inconsistent response from Ip2c |
||
48 | */ |
||
49 | public function testShouldRaiseException() |
||
53 | |||
54 | |||
55 | } |
||
56 |
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.