UserManagementConfigExtensionTest::setUp()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 5
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace UserManagement\Tests;
4
5
use SilverStripe\Dev\FunctionalTest;
6
use SilverStripe\SiteConfig\SiteConfig;
7
8
/**
9
 * Class UserManagementConfigExtensionTest
10
 *
11
 * @package user-management
12
 */
13
class UserManagementConfigExtensionTest extends FunctionalTest
14
{
15
    
16
    private $siteconfig;
17
18
    protected function setUp()
19
    {
20
        parent::setUp();
21
22
        $this->siteconfig = SiteConfig::create();
23
    }
24
25
    /**
26
     * Login url test
27
     */
28
    public function testgetLoginUrlID()
29
    {
30
       
31
        $loginurlid = $this->siteconfig->getLoginUrlID();
32
        $this->assertNotNull($loginurlid, "login url exists");
33
    }
34
35
36
    /**
37
     * Login call back url test
38
     */
39
    public function testgetLoginCallBackUrlID()
40
    {
41
       
42
        $logincallbackurlid = $this->siteconfig->getLoginCallBackUrlID();
43
        $this->assertNotNull($logincallbackurlid, "login call back url exists");
44
    }
45
46
    /**
47
     * Lost password url test
48
     */
49
    public function testgetLostPasswordUrlID()
50
    {
51
       
52
        $lostpasswordurlid = $this->siteconfig->getLostPasswordUrlID();
53
        $this->assertNotNull($lostpasswordurlid, "lost password url exists");
54
    }
55
56
    /**
57
     * Customer group id test
58
     */
59
    public function testgetCustomerGroupID()
60
    {
61
       
62
        $customergroupid = $this->siteconfig->getCustomerGroupID();
63
        $this->assertNull($customergroupid, "lost password url exists");
64
    }
65
66
    /**
67
     * Export fields test
68
     */
69
    public function testgetExportFieldNames()
70
    {
71
       
72
        $exportfields = $this->siteconfig->getExportFieldNames();
73
        $this->assertNotEmpty($exportfields, "export fields should be returned");
74
    }
75
    
76
    /**
77
     * CMS fields test
78
     **/
79
    public function testgetCMSFields()
80
    {
81
        //singleton(SiteConfig::class)->getCMSFields();
0 ignored issues
show
Unused Code Comprehensibility introduced by
64% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
82
    }
83
}
84