function PathautoFunctionalTestCase::testNodeOperations in Pathauto 7
Same name and namespace in other branches
- 6.2 pathauto.test \PathautoFunctionalTestCase::testNodeOperations()
- 6 pathauto.test \PathautoFunctionalTestCase::testNodeOperations()
Test node operations.
File
- ./
pathauto.test, line 554 - Functionality tests for Pathauto.
Class
- PathautoFunctionalTestCase
- Test basic pathauto functionality.
Code
function testNodeOperations() {
$node1 = $this
->drupalCreateNode(array(
'title' => 'node1',
));
$node2 = $this
->drupalCreateNode(array(
'title' => 'node2',
));
// Delete all current URL aliases.
$this
->deleteAllAliases();
$edit = array(
'operation' => 'pathauto_update_alias',
"nodes[{$node1->nid}]" => TRUE,
);
$this
->drupalPost('admin/content', $edit, t('Update'));
$this
->assertText('Updated URL alias for 1 node.');
$this
->assertEntityAlias('node', $node1, 'content/' . $node1->title);
$this
->assertEntityAlias('node', $node2, 'node/' . $node2->nid);
}