function ContentTranslationEntityBundleUITest::testContentTypeUI
Same name in other branches
- 9 core/modules/content_translation/tests/src/Functional/ContentTranslationEntityBundleUITest.php \Drupal\Tests\content_translation\Functional\ContentTranslationEntityBundleUITest::testContentTypeUI()
- 10 core/modules/content_translation/tests/src/Functional/ContentTranslationEntityBundleUITest.php \Drupal\Tests\content_translation\Functional\ContentTranslationEntityBundleUITest::testContentTypeUI()
- 11.x core/modules/content_translation/tests/src/Functional/ContentTranslationEntityBundleUITest.php \Drupal\Tests\content_translation\Functional\ContentTranslationEntityBundleUITest::testContentTypeUI()
Tests content types default translation behavior.
File
-
core/
modules/ content_translation/ tests/ src/ Functional/ ContentTranslationEntityBundleUITest.php, line 41
Class
- ContentTranslationEntityBundleUITest
- Tests the content translation behaviors on entity bundle UI.
Namespace
Drupal\Tests\content_translation\FunctionalCode
public function testContentTypeUI() {
// Create first content type.
$this->drupalCreateContentType([
'type' => 'article',
]);
// Enable content translation.
$edit = [
'language_configuration[content_translation]' => TRUE,
];
$this->drupalPostForm('admin/structure/types/manage/article', $edit, 'Save content type');
// Make sure add page does not inherit translation configuration from first
// content type.
$this->drupalGet('admin/structure/types/add');
$this->assertNoFieldChecked('edit-language-configuration-content-translation');
// Create second content type and set content translation.
$edit = [
'name' => 'Page',
'type' => 'page',
'language_configuration[content_translation]' => TRUE,
];
$this->drupalPostForm('admin/structure/types/add', $edit, 'Save and manage fields');
// Make sure the settings are saved when creating the content type.
$this->drupalGet('admin/structure/types/manage/page');
$this->assertFieldChecked('edit-language-configuration-content-translation');
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.