protected function MapWidgetAjaxTest::setUp in Map Widget 8
Overrides BrowserTestBase::setUp
File
- tests/
src/ FunctionalJavascript/ MapWidgetAjaxTest.php, line 50
Class
- MapWidgetAjaxTest
- Test widget with ajax behavior.
Namespace
Drupal\Tests\map_widget\FunctionalJavascriptCode
protected function setUp() {
parent::setUp();
$this->state = $this->container
->get('state');
// Create a field.
$definition['map_test_field'] = BaseFieldDefinition::create('map')
->setLabel('Map Widget Test')
->setDisplayOptions('view', [
'region' => 'hidden',
])
->setDisplayOptions('form', [
'type' => 'map_assoc_widget',
'region' => 'content',
'settings' => [
'size' => '40',
'key_placeholder' => 'Key placeholder for map_assoc_widget',
'value_placeholder' => 'Value placeholder for map_assoc_widget',
],
'weight' => 90,
])
->setTranslatable(FALSE)
->setDescription('Map Widget description')
->setDisplayConfigurable('form', TRUE)
->setDisplayConfigurable('view', FALSE);
$this->state
->set('entity_test.additional_base_field_definitions', $definition);
$this
->applyEntityUpdates('entity_test');
$this->user = $this
->drupalCreateUser([
'administer site configuration',
'administer entity_test content',
]);
$this
->drupalLogin($this->user);
}