summaryrefslogtreecommitdiff
path: root/modules/forum
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2010-08-09 01:18:46 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2010-08-09 01:18:46 +0000
commit8db34bb2712da77adf9efaee62e3095319c52dfa (patch)
treeaa8824ff6fb396a7175c084b4c412a03c65564c7 /modules/forum
parente60d38c7813a24759c4cc63b7394852da3e796a0 (diff)
downloadbrdo-8db34bb2712da77adf9efaee62e3095319c52dfa.tar.gz
brdo-8db34bb2712da77adf9efaee62e3095319c52dfa.tar.bz2
#877020 follow-up by andypost: Updated hotfix for _forum_topics_unread() tests to fix testbot.
Diffstat (limited to 'modules/forum')
-rw-r--r--modules/forum/forum.test21
1 files changed, 19 insertions, 2 deletions
diff --git a/modules/forum/forum.test b/modules/forum/forum.test
index aa96143a6..1cd7dfc6d 100644
--- a/modules/forum/forum.test
+++ b/modules/forum/forum.test
@@ -71,8 +71,25 @@ class ForumTestCase extends DrupalWebTestCase {
// Verify the topic and post counts on the forum page.
$this->drupalGet('forum');
- $this->assertRaw("<td class=\"topics\">\n 6 <br />\n <a href=\"/forum/3#new\">5 new</a>\n </td>");
- $this->assertRaw('<td class="posts">6</td>');
+
+ // Verify row for testing forum.
+ $forum_arg = array(':forum' => 'forum-list-' . $this->forum['tid']);
+
+ // Topics cell contains number of topics and number of unread topics.
+ $xpath = $this->buildXPathQuery('//tr[@id=:forum]//td[@class="topics"]', $forum_arg);
+ $topics = $this->xpath($xpath);
+ $topics = trim($topics[0]);
+ $this->assertEqual($topics, '6', t('Number of topics found.'));
+
+ // Verify the number of unread topics.
+ $unread_topics = _forum_topics_unread($this->forum['tid'], $this->edit_any_topics_user->uid);
+ $unread_topics = format_plural($unread_topics, '1 new', '@count new');
+ $xpath = $this->buildXPathQuery('//tr[@id=:forum]//td[@class="topics"]//a', $forum_arg);
+ $this->assertFieldByXPath($xpath, $unread_topics, t('Number of unread topics found.'));
+
+ // Verify total number of posts in forum.
+ $xpath = $this->buildXPathQuery('//tr[@id=:forum]//td[@class="posts"]', $forum_arg);
+ $this->assertFieldByXPath($xpath, '6', t('Number of posts found.'));
// Test loading multiple forum nodes on the front page.
$this->drupalLogin($this->drupalCreateUser(array('administer content types', 'create forum content')));