| Conditions | 3 |
| Paths | 3 |
| Total Lines | 21 |
| Code Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| 1 | <?php |
||
| 9 | public function testLatestGalleryImagesExtension() { |
||
| 10 | $page = $this->objFromFixture('Page', 'page02'); |
||
| 11 | $this->assertEquals(1, $page->LatestGalleryImages(1)->count()); |
||
|
1 ignored issue
–
show
|
|||
| 12 | $this->assertEquals(2, $page->LatestGalleryImages(2)->count()); |
||
|
1 ignored issue
–
show
|
|||
| 13 | $this->assertEquals(3, $page->LatestGalleryImages(3)->count()); |
||
|
1 ignored issue
–
show
|
|||
| 14 | $this->assertEquals(4, $page->LatestGalleryImages(4)->count()); |
||
|
1 ignored issue
–
show
|
|||
| 15 | // only 4 images in the fixtures |
||
| 16 | $this->assertEquals(4, $page->LatestGalleryImages(5)->count()); |
||
|
1 ignored issue
–
show
|
|||
| 17 | // Check classname and order of lastedited |
||
| 18 | $lastEdited = null; |
||
| 19 | foreach ($page->LatestGalleryImages(4) as $gi) { |
||
| 20 | if ($lastEdited == null) { |
||
| 21 | $lastEdited = $gi->LastEdited; |
||
| 22 | } else { |
||
| 23 | error_log('GalleryImage LastEdited: ' . $gi->LastEdited); |
||
| 24 | $this->assertLessThanOrEqual($lastEdited, $gi->LastEdited); |
||
| 25 | $lastEdited = $gi->LastEdited; |
||
| 26 | } |
||
| 27 | $this->assertEquals('GalleryImage', $gi->ClassName); |
||
|
1 ignored issue
–
show
|
|||
| 28 | } |
||
| 29 | } |
||
| 30 | |||
| 32 |
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.