Passed
Pull Request — master (#754)
by Robbie
02:38
created

EditableRadioFieldTest::testAllowEmptyTitle()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 0
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace SilverStripe\UserForms\Tests\Model\EditableFormField;
4
5
use SilverStripe\Dev\SapphireTest;
6
use SilverStripe\UserForms\Model\EditableFormField\EditableRadioField;
7
8
class EditableRadioFieldTest extends SapphireTest
9
{
10
    protected static $fixture_file = '../EditableFormFieldTest.yml';
11
12
    /**
13
     * Tests that this element is rendered with a custom template
14
     */
15
    public function testRenderedWithCustomTemplate()
16
    {
17
        $radio = $this->objFromFixture(EditableRadioField::class, 'radio-field');
18
        $this->assertSame(
19
            'SilverStripe\\UserForms\\FormField\\UserFormsOptionSetField',
20
            $radio->getFormField()->getTemplate()
21
        );
22
    }
23
24
    public function testAllowEmptyTitle()
25
    {
26
        /** @var EditableRadioField $field */
27
        $field = EditableRadioField::create();
28
        $field->Name = 'EditableFormField_123456';
29
        $this->assertEmpty($field->getFormField()->Title());
30
    }
31
}
32