public function testUnassignContentTypeGroupThrowsUnauthorizedException() { $contentTypeService = $this->repository->getContentTypeService(); $folderType = $contentTypeService->loadContentTypeByIdentifier('folder'); $mediaGroup = $contentTypeService->loadContentTypeGroupByIdentifier('Media'); $contentGroup = $contentTypeService->loadContentTypeGroupByIdentifier('Content'); // May not unassign last group $contentTypeService->assignContentTypeGroup($folderType, $mediaGroup); // Set anonymous as current user $this->repository->setCurrentUser($this->getStubbedUser(10)); $contentTypeService->unassignContentTypeGroup($folderType, $contentGroup); }