Completed
Branch master (8294f5)
by Sathish
01:47
created

LostPasswordPageTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 9
dl 0
loc 28
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testfindlink() 0 5 1
A testLostPasswordForm() 0 11 1
1
<?php
2
3
namespace UserManagement\Tests;
4
5
use SilverStripe\Dev\FunctionalTest;
6
7
/**
8
 * Class LostPasswordPageTest
9
 *
10
 * @package user-management
11
 */
12
class LostPasswordPageTest extends FunctionalTest
13
{
14
    
15
    /**
16
     * Lost password page link test
17
     */
18
    public function testfindlink()
19
    {
20
       
21
        $page = $this->get("forgotten-password/");  // attempt to access the Lost Forgot Page
22
        $this->assertEquals(200, $page->getStatusCode(), "a page should load");
23
    }
24
25
26
    /**
27
     * Lost password form test
28
     */
29
    public function testLostPasswordForm()
30
    {
31
32
        $this->get("forgotten-password/");
33
34
        $this->submitForm("LostPasswordForm_lostPasswordForm", "action_forgotPassword", array("Email" => "[email protected]"));
35
        
36
        $this->assertEquals(
37
            false,
38
            http_response_code(),
39
            'testLostPasswordForm() sends email'
40
        );
41
    }
42
}
43