class ContentModerationStateResourceTest in Drupal 10
Same name and namespace in other branches
- 8 core/modules/content_moderation/tests/src/Kernel/ContentModerationStateResourceTest.php \Drupal\Tests\content_moderation\Kernel\ContentModerationStateResourceTest
- 9 core/modules/content_moderation/tests/src/Kernel/ContentModerationStateResourceTest.php \Drupal\Tests\content_moderation\Kernel\ContentModerationStateResourceTest
@group content_moderation
Hierarchy
- class \Drupal\KernelTests\KernelTestBase extends \PHPUnit\Framework\TestCase implements ServiceProviderInterface uses \Drupal\Tests\PhpUnitCompatibilityTrait, \Symfony\Bridge\PhpUnit\ExpectDeprecationTrait, AssertContentTrait, ConfigTestTrait, ExtensionListTestTrait, RandomGeneratorTrait, TestRequirementsTrait, PhpUnitWarnings
- class \Drupal\Tests\content_moderation\Kernel\ContentModerationStateResourceTest
Expanded class hierarchy of ContentModerationStateResourceTest
File
- core/
modules/ content_moderation/ tests/ src/ Kernel/ ContentModerationStateResourceTest.php, line 13
Namespace
Drupal\Tests\content_moderation\KernelView source
class ContentModerationStateResourceTest extends KernelTestBase {
/**
* {@inheritdoc}
*/
protected static $modules = [
'serialization',
'rest',
'content_moderation',
];
/**
* @see \Drupal\content_moderation\Entity\ContentModerationState
*/
public function testCreateContentModerationStateResource() {
$this
->expectException(PluginNotFoundException::class);
$this
->expectExceptionMessage('The "entity:content_moderation_state" plugin does not exist.');
RestResourceConfig::create([
'id' => 'entity.content_moderation_state',
'granularity' => RestResourceConfigInterface::RESOURCE_GRANULARITY,
'configuration' => [
'methods' => [
'GET',
],
'formats' => [
'json',
],
'authentication' => [
'cookie',
],
],
])
->enable()
->save();
}
}