You are here

function PathautoFunctionalTestCase::testPatternsValidation in Pathauto 6.2

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

File

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

Class

PathautoFunctionalTestCase
Test basic pathauto functionality.

Code

function testPatternsValidation() {
  $edit = array();
  $edit['pathauto_node_pattern'] = '[title-raw]/[user-created-small]/[cat]/[term]';
  $edit['pathauto_node_page_pattern'] = 'page';
  $this
    ->drupalPost('admin/build/path/patterns', $edit, 'Save configuration');
  $this
    ->assertText('The Default path pattern (applies to all node types with blank patterns below) is using the following invalid tokens: [user-created-small], [cat].');
  $this
    ->assertText('The Pattern for all Page paths cannot contain fewer than one token.');
  $this
    ->assertNoText('The configuration options have been saved.');
  $edit['pathauto_node_pattern'] = '[title-raw]';
  $edit['pathauto_node_page_pattern'] = 'page/[title-raw]';
  $edit['pathauto_node_story_pattern'] = '';
  $this
    ->drupalPost('admin/build/path/patterns', $edit, 'Save configuration');
  $this
    ->assertText('The configuration options have been saved.');
}