3 namespace Drupal\Tests\workspaces\Kernel;
5 use Drupal\Component\Plugin\Exception\PluginNotFoundException;
6 use Drupal\KernelTests\KernelTestBase;
7 use Drupal\rest\Entity\RestResourceConfig;
8 use Drupal\rest\RestResourceConfigInterface;
11 * Tests REST module with internal workspace entity types.
15 class WorkspaceInternalResourceTest extends KernelTestBase {
20 public static $modules = ['user', 'serialization', 'rest', 'workspaces'];
23 * Tests enabling workspace associations for REST throws an exception.
25 * @see \Drupal\workspaces\Entity\WorkspaceAssociation
27 public function testCreateWorkspaceAssociationResource() {
28 $this->setExpectedException(PluginNotFoundException::class, 'The "entity:workspace_association" plugin does not exist.');
29 RestResourceConfig::create([
30 'id' => 'entity.workspace_association',
31 'granularity' => RestResourceConfigInterface::RESOURCE_GRANULARITY,
34 'formats' => ['json'],
35 'authentication' => ['cookie'],