Conditions | 1 |
Paths | 1 |
Total Lines | 31 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
12 | public function testDirectoryIndex() |
||
13 | { |
||
14 | $referenceRepository = $this->loadClientAndFixtures([Users::class]); |
||
15 | |||
16 | $this->logIn($this->getUser(Users::COMMITTER, $referenceRepository)); |
||
17 | |||
18 | $crawler = $this->client->request('GET', '/browse/?action=list'); |
||
19 | //$this->assertStatusCode(200, $client); |
||
20 | $this->assertEquals(200, $this->client->getResponse()->getStatusCode()); |
||
21 | |||
22 | $cards = $crawler->filter('.card'); |
||
23 | $this->assertCount(2, $cards); |
||
24 | |||
25 | $firstCard = $cards->eq(0); |
||
26 | $this->assertEquals('Folders', $firstCard->filter('.card-header')->text()); |
||
27 | $listGroupItems = $firstCard->filter('.list-group-item'); |
||
28 | $this->assertCount(1, $listGroupItems); |
||
29 | $this->assertEquals( |
||
30 | 'Examples', |
||
31 | $listGroupItems->eq(0)->filter('.ddr-gitki-item-name a')->text() |
||
32 | ); |
||
33 | |||
34 | $secondCard = $cards->eq(1); |
||
35 | $this->assertEquals('Files', $secondCard->filter('.card-header')->text()); |
||
36 | $listGroupItems = $secondCard->filter('.list-group-item'); |
||
37 | $this->assertCount(1, $secondCard->filter('.list-group-item')); |
||
38 | $this->assertEquals( |
||
39 | 'index.md', |
||
40 | trim($listGroupItems->eq(0)->filter('.ddr-gitki-item-name a')->text()) |
||
41 | ); |
||
42 | } |
||
43 | } |
||
44 |