public function testUnassignContentTypeGroupThrowsBadStateException() { /* BEGIN: Use Case */ $contentTypeService = $this->repository->getContentTypeService(); $folderType = $contentTypeService->loadContentTypeByIdentifier('folder'); $assignedGroups = $folderType->contentTypeGroups; foreach ($assignedGroups as $assignedGroup) { // Throws an exception, when last group is to be removed $contentTypeService->unassignContentTypeGroup($folderType, $assignedGroup); } /* END: Use Case */ }