SignUpFormTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 8
dl 0
loc 19
rs 10
c 0
b 0
f 0
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A testMyForm() 0 13 2
1
<?php
2
3
namespace UserManagement\Tests;
4
5
use UserManagement\Forms\SignUpForm;
6
use SilverStripe\Dev\FunctionalTest;
7
use SilverStripe\Security\Member;
8
9
/**
10
 * Class SignUpFormTest
11
 *
12
 * @package user-management
13
 */
14
class SignUpFormTest extends FunctionalTest
15
{
16
    
17
    /**
18
     * Signup form test
19
     */
20
    public function testMyForm()
21
    {
22
23
        $this->get("user-registration/");
24
25
        $this->submitForm("SignUpForm", "action_doSubmit", array("FirstName" => "John",
26
            "Password[_Password]" => "admin",
27
            "Password[_ConfirmPassword]" => "admin", "Email" => "[email protected]"));
28
29
        $this->assertEquals(
30
            1,
31
            Member::get()->filter("Email", "[email protected]")->count() > 0 ? 1 : 0,
32
            'testMyForm() returns the user email'
33
        );
34
    }
35
}
36