1 path_pattern.test PathPatternFunctionalTestCase::testNodeOperations()

Test node operations.

File

core/modules/path/tests/path_pattern.test, line 604
Functionality tests for automatic path generation.

Class

PathPatternFunctionalTestCase
Test basic Path automatic URL alias functionality.

Code

function testNodeOperations() {
  $node1 = $this->backdropCreateNode(array('title' => 'node1'));
  $node2 = $this->backdropCreateNode(array('title' => 'node2'));

  // Delete all current URL aliases.
  $this->deleteAllAliases();

  $edit = array(
    'action' => 'path_node_update_action',
    'bulk_form[1]' => TRUE,
  );
  $this->backdropPost('admin/content', $edit, t('Execute'), array('query' => array('order' => 'type', 'sort' => 'asc')));
  $this->assertRaw(format_string('%action was applied to 1 item', array('%action' => 'Update content URL alias')));

  $this->assertEntityAlias('node', $node1, 'content/' . $node1->title);
  $this->assertEntityAlias('node', $node2, 'node/' . $node2->nid);
}