public function testAssignContentTypeGroupThrowsInvalidArgumentException() { /* BEGIN: Use Case */ $contentTypeService = $this->repository->getContentTypeService(); $folderType = $contentTypeService->loadContentTypeByIdentifier('folder'); $assignedGroups = $folderType->contentTypeGroups; foreach ($assignedGroups as $assignedGroup) { // Throws an exception, since group is already assigned $contentTypeService->assignContentTypeGroup($folderType, $assignedGroup); } /* END: Use Case */ }