You are here

public function ContentModerationStateResourceTest::testCreateContentModerationStateResource in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/content_moderation/tests/src/Kernel/ContentModerationStateResourceTest.php \Drupal\Tests\content_moderation\Kernel\ContentModerationStateResourceTest::testCreateContentModerationStateResource()

See also

\Drupal\content_moderation\Entity\ContentModerationState

File

core/modules/content_moderation/tests/src/Kernel/ContentModerationStateResourceTest.php, line 23

Class

ContentModerationStateResourceTest
@group content_moderation

Namespace

Drupal\Tests\content_moderation\Kernel

Code

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();
}