3 namespace Drupal\Tests\user\Functional\Rest;
5 use Drupal\Tests\rest\Functional\EntityResource\EntityResourceTestBase;
6 use Drupal\user\Entity\Role;
8 abstract class RoleResourceTestBase extends EntityResourceTestBase {
13 public static $modules = ['user'];
18 protected static $entityTypeId = 'user_role';
21 * @var \Drupal\user\RoleInterface
28 protected function setUpAuthorization($method) {
29 $this->grantPermissionsToTestedRole(['administer permissions']);
35 protected function createEntity() {
36 $role = Role::create([
38 'name' => $this->randomString(),
48 protected function getExpectedNormalizedEntity() {
50 'uuid' => $this->entity->uuid(),
65 protected function getNormalizedPostEntity() {
66 // @todo Update in https://www.drupal.org/node/2300677.