Completed
Push — master ( 18f749...9fc766 )
by Gordon
17:08 queued 02:10
created

LatestGalleryImagesExtensionTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1
Metric Value
wmc 3
lcom 0
cbo 1
dl 0
loc 29
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A testLatestGalleryImagesExtension() 0 21 3
1
<?php
2
3
class LatestGalleryImagesExtensionTest extends TestWithImage {
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
4
    protected static $fixture_file = 'ss3gallery/tests/ss3gallery.yml';
5
6
    protected $requiredExtensions = array('Page' => array('LatestGalleryImagesExtension'));
7
8
9
    public function testLatestGalleryImagesExtension() {
10
        $page = $this->objFromFixture('Page', 'page02');
11
        $this->assertEquals(1, $page->LatestGalleryImages(1)->count());
1 ignored issue
show
Bug introduced by
The method assertEquals() does not seem to exist on object<LatestGalleryImagesExtensionTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
12
        $this->assertEquals(2, $page->LatestGalleryImages(2)->count());
1 ignored issue
show
Bug introduced by
The method assertEquals() does not seem to exist on object<LatestGalleryImagesExtensionTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
13
        $this->assertEquals(3, $page->LatestGalleryImages(3)->count());
1 ignored issue
show
Bug introduced by
The method assertEquals() does not seem to exist on object<LatestGalleryImagesExtensionTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
14
        $this->assertEquals(4, $page->LatestGalleryImages(4)->count());
1 ignored issue
show
Bug introduced by
The method assertEquals() does not seem to exist on object<LatestGalleryImagesExtensionTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
15
        // only 4 images in the fixtures
16
        $this->assertEquals(4, $page->LatestGalleryImages(5)->count());
1 ignored issue
show
Bug introduced by
The method assertEquals() does not seem to exist on object<LatestGalleryImagesExtensionTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
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);
0 ignored issues
show
Bug introduced by
The method assertLessThanOrEqual() does not seem to exist on object<LatestGalleryImagesExtensionTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
25
                $lastEdited = $gi->LastEdited;
26
            }
27
            $this->assertEquals('GalleryImage', $gi->ClassName);
1 ignored issue
show
Bug introduced by
The method assertEquals() does not seem to exist on object<LatestGalleryImagesExtensionTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
28
        }
29
    }
30
31
}
32