ContentTranslationEntityBundleUITest.php in Zircon Profile 8
File
core/modules/content_translation/src/Tests/ContentTranslationEntityBundleUITest.php
View source
<?php
namespace Drupal\content_translation\Tests;
use Drupal\simpletest\WebTestBase;
class ContentTranslationEntityBundleUITest extends WebTestBase {
public static $modules = array(
'language',
'content_translation',
'node',
'comment',
'field_ui',
);
protected function setUp() {
parent::setUp();
$user = $this
->drupalCreateUser(array(
'access administration pages',
'administer languages',
'administer content translation',
'administer content types',
));
$this
->drupalLogin($user);
}
public function testContentTypeUI() {
$this
->drupalCreateContentType(array(
'type' => 'article',
));
$edit = array(
'language_configuration[content_translation]' => TRUE,
);
$this
->drupalPostForm('admin/structure/types/manage/article', $edit, 'Save content type');
$this
->drupalGet('admin/structure/types/add');
$this
->assertNoFieldChecked('edit-language-configuration-content-translation');
$edit = array(
'name' => 'Page',
'type' => 'page',
'language_configuration[content_translation]' => TRUE,
);
$this
->drupalPostForm('admin/structure/types/add', $edit, 'Save and manage fields');
$this
->drupalGet('admin/structure/types/manage/page');
$this
->assertFieldChecked('edit-language-configuration-content-translation');
}
}