abstract class RoleResourceTestBase in Drupal 10
Same name and namespace in other branches
- 8 core/modules/user/tests/src/Functional/Rest/RoleResourceTestBase.php \Drupal\Tests\user\Functional\Rest\RoleResourceTestBase
- 9 core/modules/user/tests/src/Functional/Rest/RoleResourceTestBase.php \Drupal\Tests\user\Functional\Rest\RoleResourceTestBase
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\rest\Functional\ResourceTestBase
- class \Drupal\Tests\rest\Functional\EntityResource\EntityResourceTestBase
- class \Drupal\Tests\rest\Functional\EntityResource\ConfigEntityResourceTestBase
- class \Drupal\Tests\user\Functional\Rest\RoleResourceTestBase
- class \Drupal\Tests\rest\Functional\EntityResource\ConfigEntityResourceTestBase
- class \Drupal\Tests\rest\Functional\EntityResource\EntityResourceTestBase
- class \Drupal\Tests\rest\Functional\ResourceTestBase
Expanded class hierarchy of RoleResourceTestBase
File
- core/
modules/ user/ tests/ src/ Functional/ Rest/ RoleResourceTestBase.php, line 8
Namespace
Drupal\Tests\user\Functional\RestView source
abstract class RoleResourceTestBase extends ConfigEntityResourceTestBase {
/**
* {@inheritdoc}
*/
protected static $modules = [
'user',
];
/**
* {@inheritdoc}
*/
protected static $entityTypeId = 'user_role';
/**
* @var \Drupal\user\RoleInterface
*/
protected $entity;
/**
* {@inheritdoc}
*/
protected function setUpAuthorization($method) {
$this
->grantPermissionsToTestedRole([
'administer permissions',
]);
}
/**
* {@inheritdoc}
*/
protected function createEntity() {
$role = Role::create([
'id' => 'llama',
'label' => 'Llama',
]);
$role
->save();
return $role;
}
/**
* {@inheritdoc}
*/
protected function getExpectedNormalizedEntity() {
return [
'uuid' => $this->entity
->uuid(),
'weight' => 2,
'langcode' => 'en',
'status' => TRUE,
'dependencies' => [],
'id' => 'llama',
'label' => 'Llama',
'is_admin' => NULL,
'permissions' => [],
];
}
/**
* {@inheritdoc}
*/
protected function getNormalizedPostEntity() {
// @todo Update in https://www.drupal.org/node/2300677.
return [];
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
RoleResourceTestBase:: |
protected | property | ||
RoleResourceTestBase:: |
protected static | property | ||
RoleResourceTestBase:: |
protected static | property | 2 | |
RoleResourceTestBase:: |
protected | function | ||
RoleResourceTestBase:: |
protected | function | ||
RoleResourceTestBase:: |
protected | function | ||
RoleResourceTestBase:: |
protected | function |