protected function PMPAPIPermissionsWebTestCase::createContentType in Public Media Platform API Integration 7
Creates a new content type.
Parameters
$instances: Any instances to be added to the content type.
3 calls to PMPAPIPermissionsWebTestCase::createContentType()
- PMPAPIPermissionsWebTestCase::testPmpAPIPermissionsPushNodeWhitelistAll in pmpapi_permissions/
tests/ pmpapi_permissions.test - Pushes a node to the PMP.
- PMPAPIPermissionsWebTestCase::testPmpAPIPermissionsPushNodeWhitelistGroup in pmpapi_permissions/
tests/ pmpapi_permissions.test - Pushes a node to the PMP.
- PMPAPIPermissionsWebTestCase::testPmpAPIPermissionsPushNodeWhitelistOnlyUser in pmpapi_permissions/
tests/ pmpapi_permissions.test - Pushes a node to the PMP.
File
- pmpapi_permissions/
tests/ pmpapi_permissions.test, line 144
Class
- PMPAPIPermissionsWebTestCase
- Tests the functionality of the PMPAPI permissions module.
Code
protected function createContentType($instances = array()) {
$content_type = $this
->drupalCreateContentType(array(
'type' => $this->nodetype,
));
if (!empty($instances)) {
foreach ($instances as $instance) {
$instance['entity_type'] = 'node';
$instance['bundle'] = $this->nodetype;
field_create_instance($instance);
}
}
return $content_type;
}