function PathautoFunctionalTestCase::testPatternsValidation in Pathauto 6
Same name and namespace in other branches
- 6.2 pathauto.test \PathautoFunctionalTestCase::testPatternsValidation()
- 7 pathauto.test \PathautoFunctionalTestCase::testPatternsValidation()
File
- ./
pathauto.test, line 581 - 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/pathauto', $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 should contain at least one token to ensure unique URL aliases are created.');
$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/pathauto', $edit, 'Save configuration');
$this
->assertText('The configuration options have been saved.');
}