summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcatch2011-11-03 11:03:47 (GMT)
committercatch2011-11-03 11:03:47 (GMT)
commit255d9883fc98d5ee4afc4b5f6edc5846228522f8 (patch)
treee0a2c6859a0a05283f5bb2a0bb4c613774dcc016
parent5f46023c783bf9da382c63b91a057230a6a6f4e5 (diff)
Issue #1045786 by Désiré, droplet: Fixed Length of Trimmed Description.
-rw-r--r--core/modules/aggregator/aggregator.processor.inc2
-rw-r--r--core/modules/aggregator/aggregator.test31
2 files changed, 32 insertions, 1 deletions
diff --git a/core/modules/aggregator/aggregator.processor.inc b/core/modules/aggregator/aggregator.processor.inc
index 79261b6..097cd1e 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 c4f42a4..381fb95 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' => '<a>',
+ '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(