function PathautoUnitTestCase::testEntityBundleRenamingDeleting in Pathauto 6
Same name and namespace in other branches
- 6.2 pathauto.test \PathautoUnitTestCase::testEntityBundleRenamingDeleting()
- 7 pathauto.test \PathautoUnitTestCase::testEntityBundleRenamingDeleting()
File
- ./pathauto.test, line 364
- Functionality tests for Pathauto.
Class
- PathautoUnitTestCase
- Unit tests for Pathauto functions.
Code
function testEntityBundleRenamingDeleting() {
$vocabulary = $this
->addVocabulary();
variable_set('pathauto_taxonomy_pattern', 'base');
variable_set('pathauto_taxonomy_' . $vocabulary->vid . '_pattern', 'bundle');
$this
->assertEntityPattern('taxonomy', $vocabulary->vid, '', 'bundle');
taxonomy_del_vocabulary($vocabulary->vid);
$this
->assertEntityPattern('taxonomy', $vocabulary->vid, '', 'base');
$type = $this
->addNodeType(array(
'type' => 'old_name',
));
variable_set('pathauto_node_pattern', 'base');
variable_set("pathauto_node_old_name_pattern", 'bundle');
$this
->assertEntityPattern('node', 'old_name', '', 'bundle');
$type->type = 'new_name';
$type->old_type = 'old_name';
node_type_save($type);
node_types_rebuild();
$this
->assertEntityPattern('node', 'new_name', '', 'bundle');
$this
->assertEntityPattern('node', 'old_name', '', 'base');
node_type_delete($type->type);
$this
->assertEntityPattern('node', 'new_name', '', 'base');
}