public testAssignContentTypeGroup ( ) |
public function testAssignContentTypeGroup()
{
/* BEGIN: Use Case */
$contentTypeService = $this->repository->getContentTypeService();
$mediaGroup = $contentTypeService->loadContentTypeGroupByIdentifier('Media');
$folderType = $contentTypeService->loadContentTypeByIdentifier('folder');
$contentTypeService->assignContentTypeGroup($folderType, $mediaGroup);
/* END: Use Case */
$loadedType = $contentTypeService->loadContentType($folderType->id);
foreach ($loadedType->contentTypeGroups as $loadedGroup) {
if ($mediaGroup->id == $loadedGroup->id) {
return;
}
}
$this->fail(sprintf('Group with ID "%s" not assigned to content type.', $mediaGroup->id));
}