class MediaTranslationUITest in Drupal 10
Same name and namespace in other branches
- 8 core/modules/media/tests/src/Functional/MediaTranslationUITest.php \Drupal\Tests\media\Functional\MediaTranslationUITest
- 9 core/modules/media/tests/src/Functional/MediaTranslationUITest.php \Drupal\Tests\media\Functional\MediaTranslationUITest
Tests the Media Translation UI.
@group media
Hierarchy
- class \Drupal\Tests\BrowserTestBase extends \PHPUnit\Framework\TestCase uses \Drupal\Tests\PhpUnitCompatibilityTrait, \Symfony\Bridge\PhpUnit\ExpectDeprecationTrait, FunctionalTestSetupTrait, TestSetupTrait, BlockCreationTrait, ConfigTestTrait, ExtensionListTestTrait, ContentTypeCreationTrait, NodeCreationTrait, RandomGeneratorTrait, TestRequirementsTrait, PhpUnitWarnings, UiHelperTrait, UserCreationTrait, XdebugRequestTrait
- class \Drupal\Tests\content_translation\Functional\ContentTranslationTestBase
- class \Drupal\Tests\content_translation\Functional\ContentTranslationUITestBase uses AssertPageCacheContextsAndTagsTrait
- class \Drupal\Tests\media\Functional\MediaTranslationUITest uses MediaTypeCreationTrait
- class \Drupal\Tests\content_translation\Functional\ContentTranslationUITestBase uses AssertPageCacheContextsAndTagsTrait
- class \Drupal\Tests\content_translation\Functional\ContentTranslationTestBase
Expanded class hierarchy of MediaTranslationUITest
File
- core/
modules/ media/ tests/ src/ Functional/ MediaTranslationUITest.php, line 13
Namespace
Drupal\Tests\media\FunctionalView source
class MediaTranslationUITest extends ContentTranslationUITestBase {
use MediaTypeCreationTrait;
/**
* {@inheritdoc}
*/
protected $defaultTheme = 'stark';
/**
* {@inheritdoc}
*/
protected $defaultCacheContexts = [
'languages:language_interface',
'session',
'theme',
'url.path',
'url.query_args',
'user.permissions',
'user.roles:authenticated',
];
/**
* {@inheritdoc}
*/
protected static $modules = [
'language',
'content_translation',
'media',
'media_test_source',
];
/**
* {@inheritdoc}
*/
protected function setUp() : void {
$this->entityTypeId = 'media';
$this->bundle = 'test';
parent::setUp();
}
/**
* {@inheritdoc}
*/
public function setupBundle() {
$this
->createMediaType('test', [
'id' => $this->bundle,
'queue_thumbnail_downloads' => FALSE,
]);
}
/**
* {@inheritdoc}
*/
protected function getTranslatorPermissions() {
return array_merge(parent::getTranslatorPermissions(), [
'administer media',
'edit any test media',
]);
}
/**
* {@inheritdoc}
*/
protected function getEditorPermissions() {
return [
'administer media',
'create test media',
];
}
/**
* {@inheritdoc}
*/
protected function getAdministratorPermissions() {
return array_merge(parent::getAdministratorPermissions(), [
'access administration pages',
'administer media types',
'access media overview',
'administer languages',
]);
}
/**
* {@inheritdoc}
*/
protected function getNewEntityValues($langcode) {
return [
'name' => [
[
'value' => $this
->randomMachineName(),
],
],
'field_media_test' => [
[
'value' => $this
->randomMachineName(),
],
],
] + parent::getNewEntityValues($langcode);
}
}