2017-08-22 02:15:22 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace SilverStripe\UserForms\Tests\Model\EditableFormField;
|
|
|
|
|
|
|
|
use SilverStripe\Dev\SapphireTest;
|
2020-07-21 07:30:55 +02:00
|
|
|
use SilverStripe\UserForms\FormField\UserFormsOptionSetField;
|
2017-08-22 02:15:22 +02:00
|
|
|
use SilverStripe\UserForms\Model\EditableFormField\EditableRadioField;
|
|
|
|
|
|
|
|
class EditableRadioFieldTest extends SapphireTest
|
|
|
|
{
|
|
|
|
protected static $fixture_file = '../EditableFormFieldTest.yml';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Tests that this element is rendered with a custom template
|
|
|
|
*/
|
|
|
|
public function testRenderedWithCustomTemplate()
|
|
|
|
{
|
|
|
|
$radio = $this->objFromFixture(EditableRadioField::class, 'radio-field');
|
|
|
|
$this->assertSame(
|
2020-07-21 07:30:55 +02:00
|
|
|
UserFormsOptionSetField::class,
|
2017-08-22 02:15:22 +02:00
|
|
|
$radio->getFormField()->getTemplate()
|
|
|
|
);
|
|
|
|
}
|
2018-03-23 04:18:32 +01:00
|
|
|
|
|
|
|
public function testAllowEmptyTitle()
|
|
|
|
{
|
|
|
|
/** @var EditableRadioField $field */
|
|
|
|
$field = EditableRadioField::create();
|
|
|
|
$field->Name = 'EditableFormField_123456';
|
|
|
|
$this->assertEmpty($field->getFormField()->Title());
|
|
|
|
}
|
2017-08-22 02:15:22 +02:00
|
|
|
}
|