ContentTranslationEntityBundleUITest.php in Drupal 10
File
core/modules/content_translation/tests/src/Functional/ContentTranslationEntityBundleUITest.php
View source
<?php
namespace Drupal\Tests\content_translation\Functional;
use Drupal\Tests\BrowserTestBase;
class ContentTranslationEntityBundleUITest extends BrowserTestBase {
protected static $modules = [
'language',
'content_translation',
'node',
'comment',
'field_ui',
];
protected $defaultTheme = 'stark';
protected function setUp() : void {
parent::setUp();
$user = $this
->drupalCreateUser([
'access administration pages',
'administer languages',
'administer content translation',
'administer content types',
]);
$this
->drupalLogin($user);
}
public function testContentTypeUI() {
$this
->drupalCreateContentType([
'type' => 'article',
]);
$edit = [
'language_configuration[content_translation]' => TRUE,
];
$this
->drupalGet('admin/structure/types/manage/article');
$this
->submitForm($edit, 'Save content type');
$this
->drupalGet('admin/structure/types/add');
$this
->assertSession()
->checkboxNotChecked('edit-language-configuration-content-translation');
$edit = [
'name' => 'Page',
'type' => 'page',
'language_configuration[content_translation]' => TRUE,
];
$this
->drupalGet('admin/structure/types/add');
$this
->submitForm($edit, 'Save and manage fields');
$this
->drupalGet('admin/structure/types/manage/page');
$this
->assertSession()
->checkboxChecked('edit-language-configuration-content-translation');
}
}