ContentTranslationStandardFieldsTest.php in Drupal 9
File
core/modules/content_translation/tests/src/Functional/ContentTranslationStandardFieldsTest.php
View source
<?php
namespace Drupal\Tests\content_translation\Functional;
use Drupal\Tests\BrowserTestBase;
class ContentTranslationStandardFieldsTest extends BrowserTestBase {
protected static $modules = [
'language',
'content_translation',
'node',
'comment',
'field_ui',
'entity_test',
];
protected $profile = 'standard';
protected function setUp() : void {
parent::setUp();
$admin_user = $this
->drupalCreateUser([
'access administration pages',
'administer languages',
'administer content translation',
'administer content types',
'administer node fields',
'administer comment fields',
'administer comments',
'administer comment types',
]);
$this
->drupalLogin($admin_user);
}
public function testFieldTranslatableArticle() {
$path = 'admin/config/regional/content-language';
$this
->drupalGet($path);
$this
->assertSession()
->checkboxChecked('edit-settings-block-content-basic-fields-body');
$this
->assertSession()
->checkboxChecked('edit-settings-comment-comment-fields-comment-body');
$this
->assertSession()
->checkboxChecked('edit-settings-node-article-fields-comment');
$this
->assertSession()
->checkboxChecked('edit-settings-node-article-fields-field-image');
$this
->assertSession()
->checkboxChecked('edit-settings-node-article-fields-field-tags');
$this
->assertSession()
->checkboxChecked('edit-settings-user-user-fields-user-picture');
}
public function testRevisionLogNotTranslatable() {
$path = 'admin/config/regional/content-language';
$this
->drupalGet($path);
$this
->assertSession()
->fieldNotExists('edit-settings-node-article-fields-revision-log');
}
}