Passed
Push — master ( 80cabb...a0e7de )
by Sathish
03:53
created

LostPasswordPageTest::testLostPasswordForm()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 6
nc 1
nop 0
dl 0
loc 11
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace UserManagement\Tests;
4
5
use SilverStripe\Dev\FunctionalTest;
6
use UserManagement\Page\LostPasswordPage;
7
8
/**
9
 * Class LostPasswordPageTest
10
 *
11
 * @package user-management
12
 */
13
class LostPasswordPageTest extends FunctionalTest
14
{
15
    
16
    /**
17
     * Lost password page link test
18
     */
19
    public function testfindlink()
20
    {
21
       
22
        $page = $this->get("forgotten-password/");  // attempt to access the Lost Forgot Page
23
        $this->assertEquals(200, $page->getStatusCode(), "a page should load");
24
        $this->assertEquals(LostPasswordPage::find_link(false), "/forgotten-password/", "LostPasswordPage exists");
25
    }
26
27
28
    /**
29
     * Lost password form test
30
     */
31
    public function testLostPasswordForm()
32
    {
33
34
        $this->get("forgotten-password/");
35
36
        $this->submitForm("LostPasswordForm_lostPasswordForm", "action_forgotPassword", array("Email" => "[email protected]"));
37
        
38
        $this->assertEquals(
39
            false,
40
            http_response_code(),
41
            'testLostPasswordForm() sends email'
42
        );
43
    }
44
45
    public function testCanCreate()
46
    {
47
        LostPasswordPage::create()->canCreate();
48
        $this->markTestIncomplete('Can create');
49
    }
50
51
52
}
53