You are here

function PathautoUnitTestCase::testNoTokensNoAlias in Pathauto 7

Same name and namespace in other branches
  1. 6.2 pathauto.test \PathautoUnitTestCase::testNoTokensNoAlias()
  2. 6 pathauto.test \PathautoUnitTestCase::testNoTokensNoAlias()

Test that pathauto_create_alias() will not create an alias for a pattern that does not get any tokens replaced.

File

./pathauto.test, line 286
Functionality tests for Pathauto.

Class

PathautoUnitTestCase
Unit tests for Pathauto functions.

Code

function testNoTokensNoAlias() {
  $node = $this
    ->drupalCreateNode(array(
    'title' => '',
  ));
  $this
    ->assertNoEntityAliasExists('node', $node);
  $node->title = 'hello';
  pathauto_node_update($node);
  $this
    ->assertEntityAlias('node', $node, 'content/hello');
}