$this->
drupalGet('admin/content/media'
);
$this->
assertAllMedia();
// The media admin user should be able to see all media items.
$this->
drupalLogin($this->userAdmin
);
$this->
drupalGet('admin/content/media'
);
$this->
assertAllMedia();
// The media viewer user should be able to see only published media items.
$this->
drupalLogin($this->userViewer
);
$this->
drupalGet('admin/content/media'
);
$this->
assertOnlyPublishedMedia();
// The media viewer user that can also view its own unpublished media should
// also be able to see only published media items since it is not the owner
// of the created media items.
$this->
drupalLogin($this->userViewOwnUnpublished
);
$this->
drupalGet('admin/content/media'
);
$this->
assertOnlyPublishedMedia();
// When content moderation is enabled, a media viewer that can view any
// unpublished content should be able to see all media.
// @see content_moderation_entity_access()