You are here

public function ContentTranslationEntityBundleUITest::testContentTypeUI in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/content_translation/src/Tests/ContentTranslationEntityBundleUITest.php \Drupal\content_translation\Tests\ContentTranslationEntityBundleUITest::testContentTypeUI()

Tests content types default translation behaviour.

File

core/modules/content_translation/src/Tests/ContentTranslationEntityBundleUITest.php, line 30
Contains \Drupal\content_translation\Tests\ContentTranslationEntityBundleUITest.

Class

ContentTranslationEntityBundleUITest
Tests the content translation behaviours on entity bundle UI.

Namespace

Drupal\content_translation\Tests

Code

public function testContentTypeUI() {

  // Create first content type.
  $this
    ->drupalCreateContentType(array(
    'type' => 'article',
  ));

  // Enable content translation.
  $edit = array(
    '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 = array(
    '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');
}