1 path_pattern.test PathPatternFunctionalTestCase::testNodeOperations()

Test node operations.

File

core/modules/path/tests/path_pattern.test, line 614
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[0]' => TRUE,
  );
  $this->backdropPost('admin/content', $edit, t('Execute'), array('query' => array('order' => 'title', '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);
}