| Conditions | 3 |
| Paths | 4 |
| Total Lines | 16 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| 1 | <?php |
||
| 7 | public function testSiteMap() |
||
| 8 | { |
||
| 9 | $this->logInWithPermission('ADMIN'); |
||
| 10 | // pages need published, fixtures are not |
||
| 11 | foreach (Page::get() as $page) { |
||
| 12 | $page->doPublish(); |
||
| 13 | } |
||
| 14 | $response = $this->get('/sitemap/'); |
||
| 15 | $this->assertEquals(200, $response->getStatusCode()); |
||
| 16 | $body = $response->getBody(); |
||
| 17 | for ($i=1; $i <= 4; $i++) { |
||
| 18 | $row = '<li class="link"><a href="/page-' . $i . '/" title="Page ' |
||
| 19 | . $i . '">Page ' . $i . '</a></li>'; |
||
| 20 | $this->assertContains($row, $body); |
||
| 21 | } |
||
| 22 | } |
||
| 23 | } |
||
| 24 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.