Security update for Core, with self-updated composer
[yaffs-website] / web / core / modules / content_moderation / tests / src / Kernel / ContentModerationStateResourceTest.php
1 <?php
2
3 namespace Drupal\Tests\content_moderation\Kernel;
4
5 use Drupal\Component\Plugin\Exception\PluginNotFoundException;
6 use Drupal\KernelTests\KernelTestBase;
7 use Drupal\rest\Entity\RestResourceConfig;
8 use Drupal\rest\RestResourceConfigInterface;
9
10 /**
11  * @group content_moderation
12  */
13 class ContentModerationStateResourceTest extends KernelTestBase {
14
15   /**
16    * {@inheritdoc}
17    */
18   public static $modules = ['serialization', 'rest', 'content_moderation'];
19
20   /**
21    * @see content_moderation_rest_resource_alter()
22    */
23   public function testCreateContentModerationStateResource() {
24     $this->setExpectedException(PluginNotFoundException::class, 'The "entity:content_moderation_state" plugin does not exist.');
25     RestResourceConfig::create([
26       'id' => 'entity.content_moderation_state',
27       'granularity' => RestResourceConfigInterface::RESOURCE_GRANULARITY,
28       'configuration' => [
29         'methods' => ['GET'],
30         'formats' => ['json'],
31         'authentication' => ['cookie'],
32       ],
33     ])
34       ->enable()
35       ->save();
36   }
37
38 }