From 17d818b2b2566c12a9b0f90f3f483959d480f70b Mon Sep 17 00:00:00 2001 From: Alex Barth <alex_b@53995.no-reply.drupal.org> Date: Fri, 23 Oct 2009 21:13:47 +0000 Subject: [PATCH] Add test modules. --- tests/feeds_test.info | 7 +++++++ tests/feeds_test.module | 45 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 tests/feeds_test.info create mode 100644 tests/feeds_test.module diff --git a/tests/feeds_test.info b/tests/feeds_test.info new file mode 100644 index 00000000..58455a75 --- /dev/null +++ b/tests/feeds_test.info @@ -0,0 +1,7 @@ +; $Id$ +name = "Feeds tests" +description = "Test module for Feeds." +package = Testing +version = VERSION +core = 6.x +; hidden = TRUE \ No newline at end of file diff --git a/tests/feeds_test.module b/tests/feeds_test.module new file mode 100644 index 00000000..3cbcb09c --- /dev/null +++ b/tests/feeds_test.module @@ -0,0 +1,45 @@ +<?php +// $Id$ + +/** + * @file + * Test module for Feeds. + */ + +/** + * Implementation of hook_menu(). + */ +function feeds_test_menu() { + $items = array(); + $items['opml-test-feed'] = array( + 'page callback' => 'feeds_test_opml_feed', + 'access arguments' => array('access content'), + ); + return $items; +} + +/** + * Render an OPML feed pointing to local feeds. + */ +function feeds_test_opml_feed() { + $path = dirname($GLOBALS['_SERVER']['SCRIPT_FILENAME']) .'/'. drupal_get_path('module', 'feeds') .'/tests/feeds/'; + + drupal_set_header('Content-Type: application/rss+xml; charset=utf-8'); + $output = +'<?xml version="1.0" encoding="utf-8"?> +<opml version="1.1"> +<head> + <title>Feeds test OPML</title> + <dateCreated>Fri, 16 Oct 2009 02:53:17 GMT</dateCreated> + <ownerName></ownerName> +</head> +<body> + <outline text="Feeds test group" > + <outline title="Development Seed - Technological Solutions for Progressive Organizations" text="" xmlUrl="'. $path .'developmentseed.rss2" type="rss" /> + <outline title="Magyar Nemzet Online - H’rek" text="" xmlUrl="'. $path .'feed_without_guid.rss2" type="rss" /> + <outline title="Drupal planet" text="" type="rss" xmlUrl="'. $path .'drupalplanet.rss2" /> + </outline> +</body> +</opml>'; + print $output; +} \ No newline at end of file -- GitLab