mirror of
https://github.com/silverstripe/silverstripe-userforms.git
synced 2024-10-22 17:05:42 +02:00
24 lines
772 B
PHP
24 lines
772 B
PHP
<?php
|
|
|
|
namespace SilverStripe\UserForms\Tests\Model\EditableFormField;
|
|
|
|
use SilverStripe\Core\Config\Config;
|
|
use SilverStripe\Dev\SapphireTest;
|
|
use SilverStripe\Forms\DropdownField;
|
|
use SilverStripe\UserForms\Model\EditableFormField\EditableTextField;
|
|
|
|
class EditableTextFieldTest extends SapphireTest
|
|
{
|
|
public function testGetCmsFields()
|
|
{
|
|
Config::modify()->set(EditableTextField::class, 'autocomplete_options', ['foo' => 'foo']);
|
|
|
|
$field = new EditableTextField;
|
|
$result = $field->getCMSFields();
|
|
|
|
$autocompleteField = $result->fieldByName('Root.Main.Autocomplete');
|
|
$this->assertInstanceOf(DropdownField::class, $autocompleteField);
|
|
$this->assertEquals(['foo' => 'foo'], $autocompleteField->getSource());
|
|
}
|
|
}
|