public function LingotekSettingsTabContentFormTest::testICanDisableFields in Lingotek Translation 3.4.x
Same name and namespace in other branches
- 8.2 tests/src/Functional/Form/LingotekSettingsTabContentFormTest.php \Drupal\Tests\lingotek\Functional\Form\LingotekSettingsTabContentFormTest::testICanDisableFields()
- 4.0.x tests/src/Functional/Form/LingotekSettingsTabContentFormTest.php \Drupal\Tests\lingotek\Functional\Form\LingotekSettingsTabContentFormTest::testICanDisableFields()
- 3.0.x tests/src/Functional/Form/LingotekSettingsTabContentFormTest.php \Drupal\Tests\lingotek\Functional\Form\LingotekSettingsTabContentFormTest::testICanDisableFields()
- 3.1.x tests/src/Functional/Form/LingotekSettingsTabContentFormTest.php \Drupal\Tests\lingotek\Functional\Form\LingotekSettingsTabContentFormTest::testICanDisableFields()
- 3.2.x tests/src/Functional/Form/LingotekSettingsTabContentFormTest.php \Drupal\Tests\lingotek\Functional\Form\LingotekSettingsTabContentFormTest::testICanDisableFields()
- 3.3.x tests/src/Functional/Form/LingotekSettingsTabContentFormTest.php \Drupal\Tests\lingotek\Functional\Form\LingotekSettingsTabContentFormTest::testICanDisableFields()
- 3.5.x tests/src/Functional/Form/LingotekSettingsTabContentFormTest.php \Drupal\Tests\lingotek\Functional\Form\LingotekSettingsTabContentFormTest::testICanDisableFields()
- 3.6.x tests/src/Functional/Form/LingotekSettingsTabContentFormTest.php \Drupal\Tests\lingotek\Functional\Form\LingotekSettingsTabContentFormTest::testICanDisableFields()
- 3.7.x tests/src/Functional/Form/LingotekSettingsTabContentFormTest.php \Drupal\Tests\lingotek\Functional\Form\LingotekSettingsTabContentFormTest::testICanDisableFields()
- 3.8.x tests/src/Functional/Form/LingotekSettingsTabContentFormTest.php \Drupal\Tests\lingotek\Functional\Form\LingotekSettingsTabContentFormTest::testICanDisableFields()
File
- tests/src/Functional/Form/LingotekSettingsTabContentFormTest.php, line 258
Class
- LingotekSettingsTabContentFormTest
- Tests the Lingotek content settings form.
Namespace
Drupal\Tests\lingotek\Functional\Form
Code
public function testICanDisableFields() {
ContentLanguageSettings::loadByEntityTypeBundle('node', 'article')
->setLanguageAlterable(TRUE)
->save();
\Drupal::service('content_translation.manager')
->setEnabled('node', 'article', TRUE);
drupal_static_reset();
\Drupal::entityTypeManager()
->clearCachedDefinitions();
$this
->applyEntityUpdates();
$this
->rebuildContainer();
$this
->applyEntityUpdates();
$this
->drupalGet('admin/lingotek/settings');
$edit = [
'node[article][enabled]' => 1,
'node[article][profiles]' => 'automatic',
'node[article][fields][title]' => 1,
'node[article][fields][body]' => 1,
'node[article][fields][field_image]' => 1,
'node[article][fields][field_image:properties][alt]' => 'alt',
];
$this
->drupalPostForm(NULL, $edit, 'Save', [], 'lingoteksettings-tab-content-form');
$this
->assertFieldChecked('edit-node-article-fields-body');
$this
->assertFieldChecked('edit-node-article-fields-field-imageproperties-alt');
$edit = [
'node[article][enabled]' => 1,
'node[article][profiles]' => 'automatic',
'node[article][fields][title]' => 1,
'node[article][fields][body]' => FALSE,
'node[article][fields][field_image]' => FALSE,
'node[article][fields][field_image:properties][alt]' => FALSE,
];
$this
->drupalPostForm(NULL, $edit, 'Save', [], 'lingoteksettings-tab-content-form');
$this
->assertNoFieldChecked('edit-node-article-fields-body');
$this
->assertNoFieldChecked('edit-node-article-fields-field-imageproperties-alt');
}