Completed
Pull Request — master (#304)
by Jason
14:16
created

FoxyStripeSiteConfigTest   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 44
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 4
c 0
b 0
f 0
lcom 0
cbo 2
dl 0
loc 44
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A testGetCMSFields() 0 6 1
A testGetSSOLink() 0 5 1
A testGetDataFeedLink() 0 5 1
A testGetDataMap() 0 5 1
1
<?php
2
3
class FoxyStripeSiteConfigTest extends SapphireTest
4
{
5
    /**
6
     * @var string
7
     */
8
    protected static $fixture_file = 'foxystripe/tests/FoxyStripeTest.yml';
9
10
    /**
11
     *
12
     */
13
    public function testGetCMSFields()
14
    {
15
        $object = singleton('SiteConfig');
16
        $fields = $object->getCMSFields();
17
        $this->assertInstanceOf('FieldList', $fields);
18
    }
19
20
    /**
21
     *
22
     */
23
    public function testGetSSOLink()
24
    {
25
        $object = singleton('SiteConfig');
26
        $this->assertEquals($object->getSSOLink(), Director::absoluteBaseURL()."foxystripe/sso/");
0 ignored issues
show
Bug introduced by
The method assertEquals() does not seem to exist on object<FoxyStripeSiteConfigTest>.

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...
27
    }
28
29
    /**
30
     *
31
     */
32
    public function testGetDataFeedLink()
33
    {
34
        $object = singleton('SiteConfig');
35
        $this->assertEquals($object->getDataFeedLink(), Director::absoluteBaseURL()."foxystripe/");
0 ignored issues
show
Bug introduced by
The method assertEquals() does not seem to exist on object<FoxyStripeSiteConfigTest>.

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...
36
    }
37
38
    /**
39
     *
40
     */
41
    public function testGetDataMap()
42
    {
43
        $object = singleton('SiteConfig');
44
        $this->assertTrue(is_array($object->getDataMap()));
0 ignored issues
show
Bug introduced by
The method assertTrue() does not seem to exist on object<FoxyStripeSiteConfigTest>.

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...
45
    }
46
}