function PathautoTestHelper::addNodeType in Pathauto 6
Same name and namespace in other branches
- 6.2 pathauto.test \PathautoTestHelper::addNodeType()
1 call to PathautoTestHelper::addNodeType()
File
- ./
pathauto.test, line 169 - Functionality tests for Pathauto.
Class
- PathautoTestHelper
- Helper test class with some added functions for testing.
Code
function addNodeType(array $type) {
if (!isset($type['name'])) {
$type['name'] = $this
->randomName(8);
}
$type += array(
'type' => drupal_strtolower($type['name']),
'module' => 'node',
'description' => $this
->randomName(40),
'custom' => TRUE,
'modified' => TRUE,
'locked' => FALSE,
'help' => '',
'min_word_count' => '',
);
$type = (object) _node_type_set_defaults($type);
node_type_save($type);
node_types_rebuild();
return $type;
}