summaryrefslogtreecommitdiff
path: root/modules/aggregator/aggregator.test
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2008-08-03 18:16:51 +0000
committerDries Buytaert <dries@buytaert.net>2008-08-03 18:16:51 +0000
commit6b460925499451ac4ce1a3f363ac8a4152dcfc73 (patch)
treedeaf1b908c73bc4cdcf4945ddb4f60e94fad7116 /modules/aggregator/aggregator.test
parent745ac159fa215b5713ac156977c83621ce5e93e4 (diff)
downloadbrdo-6b460925499451ac4ce1a3f363ac8a4152dcfc73.tar.gz
brdo-6b460925499451ac4ce1a3f363ac8a4152dcfc73.tar.bz2
- Patch #290561 by mustafu: improved the aggregator category tests.
Diffstat (limited to 'modules/aggregator/aggregator.test')
-rw-r--r--modules/aggregator/aggregator.test13
1 files changed, 13 insertions, 0 deletions
diff --git a/modules/aggregator/aggregator.test b/modules/aggregator/aggregator.test
index 497f56525..046453211 100644
--- a/modules/aggregator/aggregator.test
+++ b/modules/aggregator/aggregator.test
@@ -357,6 +357,7 @@ class RemoveFeedItemTestCase extends AggregatorTestCase {
}
class CategorizeFeedItemTestCase extends AggregatorTestCase {
+ private static $prefix = 'simpletest_aggregator_';
/**
* Implementation of getInfo().
*/
@@ -373,6 +374,18 @@ class CategorizeFeedItemTestCase extends AggregatorTestCase {
* categorization.
*/
function testCategorizeFeedItem() {
+ // Simulate form submission on "admin/content/aggregator/add/category".
+ $edit = array('title' => $this->randomName(10, self::$prefix), 'description' => '');
+ $this->drupalPost('admin/content/aggregator/add/category', $edit, t('Save'));
+ $this->assertRaw(t('The category %title has been added.', array('%title' => $edit['title'])), t('The category %title has been added.', array('%title' => $edit['title'])));
+
+ $category = db_fetch_object(db_query("SELECT * FROM {aggregator_category} WHERE title = '%s'", $edit['title']));
+ $this->assertTrue(!empty($category), t('The category found in database.'));
+
+ $link_path = 'aggregator/categories/' . $category->cid;
+ $menu_link = db_fetch_object(db_query("SELECT * FROM {menu_links} WHERE link_path = '%s'", $link_path));
+ $this->assertTrue(!empty($menu_link), t('The menu link associated with the category found in database.'));
+
// TODO: Need to add categories to the feed on creation.
$feed = $this->createFeed();
$this->updateFeedItems($feed);