ContentTranslationEnableTest.php in Zircon Profile 8
File
core/modules/content_translation/src/Tests/ContentTranslationEnableTest.php
View source
<?php
namespace Drupal\content_translation\Tests;
use Drupal\simpletest\WebTestBase;
class ContentTranslationEnableTest extends WebTestBase {
public static $modules = [
'entity_test',
'menu_link_content',
'node',
];
public function testEnable() {
$this
->drupalLogin($this->rootUser);
$edit = [
'modules[Multilingual][content_translation][enable]' => TRUE,
'modules[Multilingual][language][enable]' => TRUE,
];
$this
->drupalPostForm('admin/modules', $edit, t('Install'));
$this
->drupalGet('admin/reports/status');
$requirement_value = $this
->cssSelect("tr.system-status-report__entry th:contains('Entity/field definitions') + td");
$this
->assertEqual(t('Up to date'), trim((string) $requirement_value[0]));
$this
->drupalGet('admin/config/regional/content-language');
$this
->assertNoRaw('entity_types[node]');
$edit = [
'entity_types[menu_link_content]' => TRUE,
'settings[menu_link_content][menu_link_content][translatable]' => TRUE,
'entity_types[entity_test_mul]' => TRUE,
'settings[entity_test_mul][entity_test_mul][translatable]' => TRUE,
];
$this
->drupalPostForm(NULL, $edit, t('Save configuration'));
$this
->drupalGet('admin/reports/status');
$requirement_value = $this
->cssSelect("tr.system-status-report__entry th:contains('Entity/field definitions') + td");
$this
->assertEqual(t('Up to date'), trim((string) $requirement_value[0]));
$edit = array(
'name' => 'foo',
'title_label' => 'title for foo',
'type' => 'foo',
);
$this
->drupalPostForm('admin/structure/types/add', $edit, t('Save content type'));
$this
->drupalGet('admin/config/regional/content-language');
$this
->assertRaw('entity_types[node]');
}
}