Completed
Pull Request — master (#12)
by Simon
01:19
created

PasswordFormTest::testConstruct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 10
rs 9.9332
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
4
namespace Firesphere\PartialUserforms\Tests;
5
6
use Firesphere\PartialUserforms\Controllers\PartialUserFormVerifyController;
7
use Firesphere\PartialUserforms\Forms\PasswordForm;
8
use SilverStripe\Dev\SapphireTest;
9
use SilverStripe\Forms\FieldList;
10
use SilverStripe\Forms\Form;
11
use SilverStripe\Forms\PasswordField;
12
13
class PasswordFormTest extends SapphireTest
14
{
15
    public function testConstruct()
16
    {
17
        $page = new \Page();
18
        $controller = new PartialUserFormVerifyController($page);
19
        $form = new PasswordForm($controller, 'PasswordForm');
20
21
        $this->assertInstanceOf(Form::class, $form);
22
        $this->assertInstanceOf(PasswordField::class, $form->Fields()->dataFieldByName('Password'));
23
        $this->assertInstanceOf(FieldList::class, $form->Actions());
24
    }
25
}
26