function PathautoFunctionalTestCase::testSettingsValidation in Pathauto 7
Same name and namespace in other branches
- 6.2 pathauto.test \PathautoFunctionalTestCase::testSettingsValidation()
- 6 pathauto.test \PathautoFunctionalTestCase::testSettingsValidation()
File
- ./
pathauto.test, line 728 - Functionality tests for Pathauto.
Class
- PathautoFunctionalTestCase
- Test basic pathauto functionality.
Code
function testSettingsValidation() {
$edit = array();
$edit['pathauto_max_length'] = 'abc';
$edit['pathauto_max_component_length'] = 'abc';
$this
->drupalPost('admin/config/search/path/settings', $edit, 'Save configuration');
$this
->assertText('The field Maximum alias length is not a valid number.');
$this
->assertText('The field Maximum component length is not a valid number.');
$this
->assertNoText('The configuration options have been saved.');
$edit['pathauto_max_length'] = '0';
$edit['pathauto_max_component_length'] = '0';
$this
->drupalPost('admin/config/search/path/settings', $edit, 'Save configuration');
$this
->assertText('The field Maximum alias length cannot be less than 1.');
$this
->assertText('The field Maximum component length cannot be less than 1.');
$this
->assertNoText('The configuration options have been saved.');
$edit['pathauto_max_length'] = '999';
$edit['pathauto_max_component_length'] = '999';
$this
->drupalPost('admin/config/search/path/settings', $edit, 'Save configuration');
$this
->assertText('The field Maximum alias length cannot be greater than 255.');
$this
->assertText('The field Maximum component length cannot be greater than 255.');
$this
->assertNoText('The configuration options have been saved.');
$edit['pathauto_max_length'] = '50';
$edit['pathauto_max_component_length'] = '50';
$this
->drupalPost('admin/config/search/path/settings', $edit, 'Save configuration');
$this
->assertText('The configuration options have been saved.');
}