You are here

function PathautoFunctionalTestCase::testNodeOperations in Pathauto 6

Same name and namespace in other branches
  1. 6.2 pathauto.test \PathautoFunctionalTestCase::testNodeOperations()
  2. 7 pathauto.test \PathautoFunctionalTestCase::testNodeOperations()

Test node operations.

File

./pathauto.test, line 514
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/node', $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);
}