MultipleSelectsWidgetTest.php in Multiple Selects 8
File
tests/src/Kernel/MultipleSelectsWidgetTest.php
View source
<?php
namespace Drupal\Tests\multiple_selects\Kernel;
use Drupal\KernelTests\KernelTestBase;
class MultipleSelectsWidgetTest extends KernelTestBase {
protected static $modules = [
'multiple_selects',
'field',
];
protected $fieldWidgetDefinitionManager;
protected function setUp() : void {
parent::setUp();
$this->fieldWidgetDefinitionManager = $this->container
->get('plugin.manager.field.widget');
}
public function testWidgetDefinitionFieldTypes() {
$widget_definition = $this->fieldWidgetDefinitionManager
->getDefinition('multiple_options_select');
$this
->assertEquals([
'entity_reference',
'list_integer',
'list_float',
'list_string',
], $widget_definition['field_types']);
}
}