protected function ConditionalFieldLanguageSelectTest::setUp in Conditional Fields 8
Same name and namespace in other branches
- 4.x tests/src/FunctionalJavascript/ConditionalFieldLanguageSelectTest.php \Drupal\Tests\conditional_fields\FunctionalJavascript\ConditionalFieldLanguageSelectTest::setUp()
Overrides ConditionalFieldTestBase::setUp
File
- tests/
src/ FunctionalJavascript/ ConditionalFieldLanguageSelectTest.php, line 71
Class
- ConditionalFieldLanguageSelectTest
- Test Conditional Fields Language Select Plugin.
Namespace
Drupal\Tests\conditional_fields\FunctionalJavascriptCode
protected function setUp() {
parent::setUp();
$this->fieldSelector = "[name=\"{$this->fieldName}[0][value]\"]";
// Get the default language which will trigger the dependency.
$this->defaultLanguage = \Drupal::languageManager()
->getCurrentLanguage()
->getId();
// Enable language selector on node creation page.
ContentLanguageSettings::loadByEntityTypeBundle('node', 'article')
->setLanguageAlterable(TRUE)
->setDefaultLangcode($this->defaultLanguage)
->save();
}