MediaFunctionalTestTrait.php in Drupal 10
File
core/modules/media/tests/src/Functional/MediaFunctionalTestTrait.php
View source
<?php
namespace Drupal\Tests\media\Functional;
trait MediaFunctionalTestTrait {
protected static $adminUserPermissions = [
'access media overview',
'administer media',
'administer media fields',
'administer media form display',
'administer media display',
'administer media types',
'view media',
'administer views',
'access content overview',
'view all revisions',
'administer content types',
'administer node fields',
'administer node form display',
'administer node display',
'bypass node access',
];
protected $adminUser;
protected $nonAdminUser;
protected $storage;
protected function setUp() : void {
parent::setUp();
$this->adminUser = $this
->drupalCreateUser(static::$adminUserPermissions);
$this->nonAdminUser = $this
->drupalCreateUser([]);
$this
->drupalLogin($this->adminUser);
$this->storage = $this->container
->get('entity_type.manager')
->getStorage('media');
}
}