| Conditions | 1 |
| Paths | 1 |
| Total Lines | 28 |
| Code Lines | 20 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 21 | public function testDirectoryIndex() |
||
| 22 | { |
||
| 23 | $this->logIn($this->getUser(Users::COMMITTER)); |
||
| 24 | |||
| 25 | $crawler = $this->client->request('GET', '/browse/?action=list'); |
||
| 26 | $this->assertStatusCode(200, $this->client); |
||
| 27 | |||
| 28 | $panels = $crawler->filter('.panel'); |
||
| 29 | $this->assertCount(2, $panels); |
||
| 30 | |||
| 31 | $firstPanel = $panels->eq(0); |
||
| 32 | $this->assertEquals('Folders', $firstPanel->filter('.panel-title')->text()); |
||
| 33 | $listGroupItems = $firstPanel->filter('.list-group-item'); |
||
| 34 | $this->assertCount(1, $listGroupItems); |
||
| 35 | $this->assertEquals( |
||
| 36 | 'Examples', |
||
| 37 | $listGroupItems->eq(0)->filter('.ddr-gitki-name a')->text() |
||
| 38 | ); |
||
| 39 | |||
| 40 | $secondPanel = $panels->eq(1); |
||
| 41 | $this->assertEquals('Files', $secondPanel->filter('.panel-title')->text()); |
||
| 42 | $listGroupItems = $secondPanel->filter('.list-group-item'); |
||
| 43 | $this->assertCount(1, $secondPanel->filter('.list-group-item')); |
||
| 44 | $this->assertEquals( |
||
| 45 | 'index.md', |
||
| 46 | trim($listGroupItems->eq(0)->filter('.ddr-gitki-name a')->text()) |
||
| 47 | ); |
||
| 48 | } |
||
| 49 | } |
||
| 50 |