function PathautoUnitTestCase::testEntityBundleRenamingDeleting in Pathauto 7
Same name and namespace in other branches
- 6.2 pathauto.test \PathautoUnitTestCase::testEntityBundleRenamingDeleting()
- 6 pathauto.test \PathautoUnitTestCase::testEntityBundleRenamingDeleting()
File
- ./pathauto.test, line 347
- Functionality tests for Pathauto.
Class
- PathautoUnitTestCase
- Unit tests for Pathauto functions.
Code
function testEntityBundleRenamingDeleting() {
$vocab = $this
->addVocabulary(array(
'machine_name' => 'old_name',
));
variable_set('pathauto_taxonomy_term_pattern', 'base');
variable_set("pathauto_taxonomy_term_old_name_pattern", 'bundle');
$this
->assertEntityPattern('taxonomy_term', 'old_name', LANGUAGE_NONE, 'bundle');
$vocab->machine_name = 'new_name';
taxonomy_vocabulary_save($vocab);
$this
->assertEntityPattern('taxonomy_term', 'new_name', LANGUAGE_NONE, 'bundle');
$this
->assertEntityPattern('taxonomy_term', 'old_name', LANGUAGE_NONE, 'base');
taxonomy_vocabulary_delete($vocab->vid);
$this
->assertEntityPattern('taxonomy_term', 'new_name', LANGUAGE_NONE, 'base');
}