Completed
Pull Request — master (#12)
by Simon
08:01 queued 06:43
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\Forms\PasswordForm;
7
use SilverStripe\Dev\SapphireTest;
8
use SilverStripe\Forms\FieldList;
9
use SilverStripe\Forms\Form;
10
use SilverStripe\Forms\PasswordField;
11
use SilverStripe\UserForms\Control\UserDefinedFormController;
12
use SilverStripe\UserForms\Model\UserDefinedForm;
13
14
class PasswordFormTest extends SapphireTest
15
{
16
    public function testConstruct()
17
    {
18
        $page = new UserDefinedForm();
19
        $controller = new UserDefinedFormController($page);
20
        $form = new PasswordForm($controller, 'PasswordForm');
21
22
        $this->assertInstanceOf(Form::class, $form);
23
        $this->assertInstanceOf(PasswordField::class, $form->Fields()->dataFieldByName('Password'));
24
        $this->assertInstanceOf(FieldList::class, $form->Actions());
25
    }
26
}
27