| Conditions | 1 |
| Paths | 1 |
| Total Lines | 19 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 20 | public function testIndexFileShown() |
||
| 21 | { |
||
| 22 | $this->login($this->getUser(Users::COMMITTER)); |
||
| 23 | |||
| 24 | $crawler = $this->client->request('GET', '/'); |
||
|
|
|||
| 25 | $this->assertStatusCode(302, $this->client); |
||
| 26 | |||
| 27 | $location = $this->client->getResponse()->headers->get('Location'); |
||
| 28 | $this->assertEquals('/browse/?action=index', $location); |
||
| 29 | $crawler = $this->client->request('GET', $location); |
||
| 30 | $this->assertStatusCode(302, $this->client); |
||
| 31 | |||
| 32 | $location = $this->client->getResponse()->headers->get('Location'); |
||
| 33 | $this->assertEquals('/browse/index.md', $location); |
||
| 34 | $crawler = $this->client->request('GET', $location); |
||
| 35 | $this->assertStatusCode(200, $this->client); |
||
| 36 | |||
| 37 | $this->assertEquals('Welcome', $crawler->filter('h1')->text()); |
||
| 38 | } |
||
| 39 | } |
||
| 40 |
This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.
Both the
$myVarassignment in line 1 and the$higherassignment in line 2 are dead. The first because$myVaris never used and the second because$higheris always overwritten for every possible time line.