3 namespace Drupal\Tests\content_translation\Functional;
5 use Drupal\Tests\BrowserTestBase;
8 * Tests the content translation behaviours on entity bundle UI.
10 * @group content_translation
12 class ContentTranslationEntityBundleUITest extends BrowserTestBase {
14 public static $modules = ['language', 'content_translation', 'node', 'comment', 'field_ui'];
16 protected function setUp() {
18 $user = $this->drupalCreateUser(['access administration pages', 'administer languages', 'administer content translation', 'administer content types']);
19 $this->drupalLogin($user);
23 * Tests content types default translation behaviour.
25 public function testContentTypeUI() {
26 // Create first content type.
27 $this->drupalCreateContentType(['type' => 'article']);
28 // Enable content translation.
29 $edit = ['language_configuration[content_translation]' => TRUE];
30 $this->drupalPostForm('admin/structure/types/manage/article', $edit, 'Save content type');
32 // Make sure add page does not inherit translation configuration from first
34 $this->drupalGet('admin/structure/types/add');
35 $this->assertNoFieldChecked('edit-language-configuration-content-translation');
37 // Create second content type and set content translation.
41 'language_configuration[content_translation]' => TRUE,
43 $this->drupalPostForm('admin/structure/types/add', $edit, 'Save and manage fields');
45 // Make sure the settings are saved when creating the content type.
46 $this->drupalGet('admin/structure/types/manage/page');
47 $this->assertFieldChecked('edit-language-configuration-content-translation');