You are here

function PathautoUnitTestCase::testNoTokensNoAlias in Pathauto 6.2

Same name and namespace in other branches
  1. 6 pathauto.test \PathautoUnitTestCase::testNoTokensNoAlias()
  2. 7 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 356
Functionality tests for Pathauto.

Class

PathautoUnitTestCase
Unit tests for Pathauto functions.

Code

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