protected function ConditionalFieldEmailTest::setUp in Conditional Fields 8
Same name and namespace in other branches
- 4.x tests/src/FunctionalJavascript/ConditionalFieldEmailTest.php \Drupal\Tests\conditional_fields\FunctionalJavascript\ConditionalFieldEmailTest::setUp()
Overrides ConditionalFieldTestBase::setUp
File
- tests/
src/ FunctionalJavascript/ ConditionalFieldEmailTest.php, line 84
Class
- ConditionalFieldEmailTest
- Test Conditional Fields Text Handler.
Namespace
Drupal\Tests\conditional_fields\FunctionalJavascriptCode
protected function setUp() {
parent::setUp();
$this->fieldSelector = '[name="field_' . $this->fieldName . '[0][value]"]';
FieldStorageConfig::create([
'field_name' => 'field_' . $this->fieldName,
'entity_type' => 'node',
'type' => 'email',
'cardinality' => 1,
])
->save();
FieldConfig::create([
'field_name' => 'field_' . $this->fieldName,
'entity_type' => 'node',
'bundle' => 'article',
'settings' => [
'min' => '',
'max' => '',
'prefix' => '',
],
])
->save();
EntityFormDisplay::load('node.article.default')
->setComponent('field_' . $this->fieldName, [
'type' => 'email_default',
'settings' => [
'prefix_suffix' => FALSE,
],
])
->save();
}