Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
drupal
Commits
8db34bb2
Commit
8db34bb2
authored
14 years ago
by
Angie Byron
Browse files
Options
Downloads
Patches
Plain Diff
#877020
follow-up by andypost: Updated hotfix for _forum_topics_unread() tests to fix testbot.
parent
e60d38c7
Branches
Branches containing commit
Tags
Tags containing commit
2 merge requests
!7452
Issue #1797438. HTML5 validation is preventing form submit and not fully...
,
!789
Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/forum/forum.test
+19
-2
19 additions, 2 deletions
modules/forum/forum.test
with
19 additions
and
2 deletions
modules/forum/forum.test
+
19
−
2
View file @
8db34bb2
...
...
@@ -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'
)));
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment