You are here

class ContentModerationStateResourceTest in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/content_moderation/tests/src/Kernel/ContentModerationStateResourceTest.php \Drupal\Tests\content_moderation\Kernel\ContentModerationStateResourceTest
  2. 9 core/modules/content_moderation/tests/src/Kernel/ContentModerationStateResourceTest.php \Drupal\Tests\content_moderation\Kernel\ContentModerationStateResourceTest

@group content_moderation

Hierarchy

Expanded class hierarchy of ContentModerationStateResourceTest

File

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

Namespace

Drupal\Tests\content_moderation\Kernel
View 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();
  }

}

Members