function ContentModerationStateResourceTest::testCreateContentModerationStateResource

Same name in other branches
  1. 9 core/modules/content_moderation/tests/src/Kernel/ContentModerationStateResourceTest.php \Drupal\Tests\content_moderation\Kernel\ContentModerationStateResourceTest::testCreateContentModerationStateResource()
  2. 10 core/modules/content_moderation/tests/src/Kernel/ContentModerationStateResourceTest.php \Drupal\Tests\content_moderation\Kernel\ContentModerationStateResourceTest::testCreateContentModerationStateResource()
  3. 11.x 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();
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.