diff --git a/core/modules/aggregator/aggregator.processor.inc b/core/modules/aggregator/aggregator.processor.inc index 79261b6186b3ea09153f53d3868aee7e31f4ca64..097cd1e9fa6ffdfbbb62976caedf9a7e67fddc93 100644 --- a/core/modules/aggregator/aggregator.processor.inc +++ b/core/modules/aggregator/aggregator.processor.inc @@ -117,7 +117,7 @@ function aggregator_form_aggregator_admin_form_alter(&$form, $form_state) { $form['modules']['aggregator']['aggregator_teaser_length'] = array( '#type' => 'select', '#title' => t('Length of trimmed description'), - '#default_value' => 600, + '#default_value' => variable_get('aggregator_teaser_length', 600), '#options' => drupal_map_assoc(array(0, 200, 400, 600, 800, 1000, 1200, 1400, 1600, 1800, 2000), '_aggregator_characters'), '#description' => t("The maximum number of characters used in the trimmed version of content.") ); diff --git a/core/modules/aggregator/aggregator.test b/core/modules/aggregator/aggregator.test index c4f42a483ed102f6c0529003a1e4ca09b9d13a4c..381fb954610b5bf72f9d055618c64b739ce1353a 100644 --- a/core/modules/aggregator/aggregator.test +++ b/core/modules/aggregator/aggregator.test @@ -278,6 +278,37 @@ EOF; } } +/** + * Tests aggregator configuration settings. + */ +class AggregatorConfigurationTestCase extends AggregatorTestCase { + public static function getInfo() { + return array( + 'name' => 'Aggregator configuration', + 'description' => 'Test aggregator settings page.', + 'group' => 'Aggregator', + ); + } + + /** + * Tests the settings form to ensure the correct default values are used. + */ + function testSettingsPage() { + $edit = array( + 'aggregator_allowed_html_tags' => '', + 'aggregator_summary_items' => 10, + 'aggregator_clear' => 3600, + 'aggregator_category_selector' => 'select', + 'aggregator_teaser_length' => 200, + ); + $this->drupalPost('admin/config/services/aggregator/settings', $edit, t('Save configuration')); + + foreach ($edit as $name => $value) { + $this->assertFieldByName($name, $value, t('"@name" has correct default value.', array('@name' => $name))); + } + } +} + class AddFeedTestCase extends AggregatorTestCase { public static function getInfo() { return array(