Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
project
drupal
Commits
3fce22c5
Commit
3fce22c5
authored
Oct 09, 2012
by
webchick
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue
#1798066
by boztek, larowlan: Clean up CommentTestBase::setCommentSettings().
parent
18e0fca3
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
17 additions
and
17 deletions
+17
-17
core/modules/comment/lib/Drupal/comment/Tests/CommentInterfaceTest.php
...comment/lib/Drupal/comment/Tests/CommentInterfaceTest.php
+2
-2
core/modules/comment/lib/Drupal/comment/Tests/CommentNodeAccessTest.php
...omment/lib/Drupal/comment/Tests/CommentNodeAccessTest.php
+1
-1
core/modules/comment/lib/Drupal/comment/Tests/CommentPagerTest.php
...les/comment/lib/Drupal/comment/Tests/CommentPagerTest.php
+6
-6
core/modules/comment/lib/Drupal/comment/Tests/CommentPreviewTest.php
...s/comment/lib/Drupal/comment/Tests/CommentPreviewTest.php
+2
-2
core/modules/comment/lib/Drupal/comment/Tests/CommentTestBase.php
...ules/comment/lib/Drupal/comment/Tests/CommentTestBase.php
+4
-4
core/modules/comment/lib/Drupal/comment/Tests/CommentThreadingTest.php
...comment/lib/Drupal/comment/Tests/CommentThreadingTest.php
+1
-1
core/modules/rdf/lib/Drupal/rdf/Tests/CommentAttributesTest.php
...odules/rdf/lib/Drupal/rdf/Tests/CommentAttributesTest.php
+1
-1
No files found.
core/modules/comment/lib/Drupal/comment/Tests/CommentInterfaceTest.php
View file @
3fce22c5
...
@@ -26,7 +26,7 @@ function testCommentInterface() {
...
@@ -26,7 +26,7 @@ function testCommentInterface() {
$this
->
setCommentPreview
(
DRUPAL_DISABLED
);
$this
->
setCommentPreview
(
DRUPAL_DISABLED
);
$this
->
setCommentForm
(
TRUE
);
$this
->
setCommentForm
(
TRUE
);
$this
->
setCommentSubject
(
FALSE
);
$this
->
setCommentSubject
(
FALSE
);
$this
->
setCommentSettings
(
'comment_default_mode'
,
COMMENT_MODE_THREADED
,
t
(
'Comment paging changed.'
)
)
;
$this
->
setCommentSettings
(
'comment_default_mode'
,
COMMENT_MODE_THREADED
,
'Comment paging changed.'
);
$this
->
drupalLogout
();
$this
->
drupalLogout
();
// Post comment #1 without subject or preview.
// Post comment #1 without subject or preview.
...
@@ -342,7 +342,7 @@ function testCommentNodeCommentStatistics() {
...
@@ -342,7 +342,7 @@ function testCommentNodeCommentStatistics() {
$this
->
setCommentPreview
(
DRUPAL_DISABLED
);
$this
->
setCommentPreview
(
DRUPAL_DISABLED
);
$this
->
setCommentForm
(
TRUE
);
$this
->
setCommentForm
(
TRUE
);
$this
->
setCommentSubject
(
FALSE
);
$this
->
setCommentSubject
(
FALSE
);
$this
->
setCommentSettings
(
'comment_default_mode'
,
COMMENT_MODE_THREADED
,
t
(
'Comment paging changed.'
)
)
;
$this
->
setCommentSettings
(
'comment_default_mode'
,
COMMENT_MODE_THREADED
,
'Comment paging changed.'
);
$this
->
drupalLogout
();
$this
->
drupalLogout
();
// Creates a second user to post comments.
// Creates a second user to post comments.
...
...
core/modules/comment/lib/Drupal/comment/Tests/CommentNodeAccessTest.php
View file @
3fce22c5
...
@@ -52,7 +52,7 @@ function testThreadedCommentView() {
...
@@ -52,7 +52,7 @@ function testThreadedCommentView() {
$this
->
setCommentPreview
(
DRUPAL_DISABLED
);
$this
->
setCommentPreview
(
DRUPAL_DISABLED
);
$this
->
setCommentForm
(
TRUE
);
$this
->
setCommentForm
(
TRUE
);
$this
->
setCommentSubject
(
TRUE
);
$this
->
setCommentSubject
(
TRUE
);
$this
->
setCommentSettings
(
'comment_default_mode'
,
COMMENT_MODE_THREADED
,
t
(
'Comment paging changed.'
)
)
;
$this
->
setCommentSettings
(
'comment_default_mode'
,
COMMENT_MODE_THREADED
,
'Comment paging changed.'
);
$this
->
drupalLogout
();
$this
->
drupalLogout
();
// Post comment.
// Post comment.
...
...
core/modules/comment/lib/Drupal/comment/Tests/CommentPagerTest.php
View file @
3fce22c5
...
@@ -37,7 +37,7 @@ function testCommentPaging() {
...
@@ -37,7 +37,7 @@ function testCommentPaging() {
$comments
[]
=
$this
->
postComment
(
$node
,
$this
->
randomName
(),
$this
->
randomName
(),
TRUE
);
$comments
[]
=
$this
->
postComment
(
$node
,
$this
->
randomName
(),
$this
->
randomName
(),
TRUE
);
$comments
[]
=
$this
->
postComment
(
$node
,
$this
->
randomName
(),
$this
->
randomName
(),
TRUE
);
$comments
[]
=
$this
->
postComment
(
$node
,
$this
->
randomName
(),
$this
->
randomName
(),
TRUE
);
$this
->
setCommentSettings
(
'comment_default_mode'
,
COMMENT_MODE_FLAT
,
t
(
'Comment paging changed.'
)
)
;
$this
->
setCommentSettings
(
'comment_default_mode'
,
COMMENT_MODE_FLAT
,
'Comment paging changed.'
);
// Set comments to one per page so that we are able to test paging without
// Set comments to one per page so that we are able to test paging without
// needing to insert large numbers of comments.
// needing to insert large numbers of comments.
...
@@ -78,7 +78,7 @@ function testCommentPaging() {
...
@@ -78,7 +78,7 @@ function testCommentPaging() {
// If we switch to threaded mode, the replies on the oldest comment
// If we switch to threaded mode, the replies on the oldest comment
// should be bumped to the first page and comment 6 should be bumped
// should be bumped to the first page and comment 6 should be bumped
// to the second page.
// to the second page.
$this
->
setCommentSettings
(
'comment_default_mode'
,
COMMENT_MODE_THREADED
,
t
(
'Switched to threaded mode.'
)
)
;
$this
->
setCommentSettings
(
'comment_default_mode'
,
COMMENT_MODE_THREADED
,
'Switched to threaded mode.'
);
$this
->
drupalGet
(
'node/'
.
$node
->
nid
,
array
(
'query'
=>
array
(
'page'
=>
0
)));
$this
->
drupalGet
(
'node/'
.
$node
->
nid
,
array
(
'query'
=>
array
(
'page'
=>
0
)));
$this
->
assertTrue
(
$this
->
commentExists
(
$reply
,
TRUE
),
'In threaded mode, reply appears on page 1.'
);
$this
->
assertTrue
(
$this
->
commentExists
(
$reply
,
TRUE
),
'In threaded mode, reply appears on page 1.'
);
$this
->
assertFalse
(
$this
->
commentExists
(
$comments
[
1
]),
'In threaded mode, comment 2 has been bumped off of page 1.'
);
$this
->
assertFalse
(
$this
->
commentExists
(
$comments
[
1
]),
'In threaded mode, comment 2 has been bumped off of page 1.'
);
...
@@ -138,7 +138,7 @@ function testCommentOrderingThreading() {
...
@@ -138,7 +138,7 @@ function testCommentOrderingThreading() {
// - 2
// - 2
// - 5
// - 5
$this
->
setCommentSettings
(
'comment_default_mode'
,
COMMENT_MODE_FLAT
,
t
(
'Comment paging changed.'
)
)
;
$this
->
setCommentSettings
(
'comment_default_mode'
,
COMMENT_MODE_FLAT
,
'Comment paging changed.'
);
$expected_order
=
array
(
$expected_order
=
array
(
0
,
0
,
...
@@ -152,7 +152,7 @@ function testCommentOrderingThreading() {
...
@@ -152,7 +152,7 @@ function testCommentOrderingThreading() {
$this
->
drupalGet
(
'node/'
.
$node
->
nid
);
$this
->
drupalGet
(
'node/'
.
$node
->
nid
);
$this
->
assertCommentOrder
(
$comments
,
$expected_order
);
$this
->
assertCommentOrder
(
$comments
,
$expected_order
);
$this
->
setCommentSettings
(
'comment_default_mode'
,
COMMENT_MODE_THREADED
,
t
(
'Switched to threaded mode.'
)
)
;
$this
->
setCommentSettings
(
'comment_default_mode'
,
COMMENT_MODE_THREADED
,
'Switched to threaded mode.'
);
$expected_order
=
array
(
$expected_order
=
array
(
0
,
0
,
...
@@ -234,7 +234,7 @@ function testCommentNewPageIndicator() {
...
@@ -234,7 +234,7 @@ function testCommentNewPageIndicator() {
// - 2
// - 2
// - 5
// - 5
$this
->
setCommentSettings
(
'comment_default_mode'
,
COMMENT_MODE_FLAT
,
t
(
'Comment paging changed.'
)
)
;
$this
->
setCommentSettings
(
'comment_default_mode'
,
COMMENT_MODE_FLAT
,
'Comment paging changed.'
);
$expected_pages
=
array
(
$expected_pages
=
array
(
1
=>
5
,
// Page of comment 5
1
=>
5
,
// Page of comment 5
...
@@ -252,7 +252,7 @@ function testCommentNewPageIndicator() {
...
@@ -252,7 +252,7 @@ function testCommentNewPageIndicator() {
$this
->
assertIdentical
(
$expected_page
,
$returned_page
,
format_string
(
'Flat mode, @new replies: expected page @expected, returned page @returned.'
,
array
(
'@new'
=>
$new_replies
,
'@expected'
=>
$expected_page
,
'@returned'
=>
$returned_page
)));
$this
->
assertIdentical
(
$expected_page
,
$returned_page
,
format_string
(
'Flat mode, @new replies: expected page @expected, returned page @returned.'
,
array
(
'@new'
=>
$new_replies
,
'@expected'
=>
$expected_page
,
'@returned'
=>
$returned_page
)));
}
}
$this
->
setCommentSettings
(
'comment_default_mode'
,
COMMENT_MODE_THREADED
,
t
(
'Switched to threaded mode.'
)
)
;
$this
->
setCommentSettings
(
'comment_default_mode'
,
COMMENT_MODE_THREADED
,
'Switched to threaded mode.'
);
$expected_pages
=
array
(
$expected_pages
=
array
(
1
=>
5
,
// Page of comment 5
1
=>
5
,
// Page of comment 5
...
...
core/modules/comment/lib/Drupal/comment/Tests/CommentPreviewTest.php
View file @
3fce22c5
...
@@ -30,7 +30,7 @@ function testCommentPreview() {
...
@@ -30,7 +30,7 @@ function testCommentPreview() {
$this
->
setCommentPreview
(
DRUPAL_OPTIONAL
);
$this
->
setCommentPreview
(
DRUPAL_OPTIONAL
);
$this
->
setCommentForm
(
TRUE
);
$this
->
setCommentForm
(
TRUE
);
$this
->
setCommentSubject
(
TRUE
);
$this
->
setCommentSubject
(
TRUE
);
$this
->
setCommentSettings
(
'comment_default_mode'
,
COMMENT_MODE_THREADED
,
t
(
'Comment paging changed.'
)
)
;
$this
->
setCommentSettings
(
'comment_default_mode'
,
COMMENT_MODE_THREADED
,
'Comment paging changed.'
);
$this
->
drupalLogout
();
$this
->
drupalLogout
();
// Login as web user and add a signature and a user picture.
// Login as web user and add a signature and a user picture.
...
@@ -76,7 +76,7 @@ function testCommentEditPreviewSave() {
...
@@ -76,7 +76,7 @@ function testCommentEditPreviewSave() {
$this
->
setCommentPreview
(
DRUPAL_OPTIONAL
);
$this
->
setCommentPreview
(
DRUPAL_OPTIONAL
);
$this
->
setCommentForm
(
TRUE
);
$this
->
setCommentForm
(
TRUE
);
$this
->
setCommentSubject
(
TRUE
);
$this
->
setCommentSubject
(
TRUE
);
$this
->
setCommentSettings
(
'comment_default_mode'
,
COMMENT_MODE_THREADED
,
t
(
'Comment paging changed.'
)
)
;
$this
->
setCommentSettings
(
'comment_default_mode'
,
COMMENT_MODE_THREADED
,
'Comment paging changed.'
);
$edit
=
array
();
$edit
=
array
();
$edit
[
'subject'
]
=
$this
->
randomName
(
8
);
$edit
[
'subject'
]
=
$this
->
randomName
(
8
);
...
...
core/modules/comment/lib/Drupal/comment/Tests/CommentTestBase.php
View file @
3fce22c5
...
@@ -175,7 +175,7 @@ function setCommentPreview($mode) {
...
@@ -175,7 +175,7 @@ function setCommentPreview($mode) {
$mode_text
=
'required'
;
$mode_text
=
'required'
;
break
;
break
;
}
}
$this
->
setCommentSettings
(
'comment_preview'
,
$mode
,
'Comment preview
'
.
$
mode_text
.
'.'
);
$this
->
setCommentSettings
(
'comment_preview'
,
$mode
,
format_string
(
'Comment preview
@
mode_text
.'
,
array
(
'@mode_text'
=>
$mode_text
))
);
}
}
/**
/**
...
@@ -199,7 +199,7 @@ function setCommentForm($enabled) {
...
@@ -199,7 +199,7 @@ function setCommentForm($enabled) {
* - 2: Contact information required.
* - 2: Contact information required.
*/
*/
function
setCommentAnonymous
(
$level
)
{
function
setCommentAnonymous
(
$level
)
{
$this
->
setCommentSettings
(
'comment_anonymous'
,
$level
,
'Anonymous commenting set to level
'
.
$level
.
'.'
);
$this
->
setCommentSettings
(
'comment_anonymous'
,
$level
,
format_string
(
'Anonymous commenting set to level
@level.'
,
array
(
'@level'
=>
$level
))
);
}
}
/**
/**
...
@@ -209,7 +209,7 @@ function setCommentAnonymous($level) {
...
@@ -209,7 +209,7 @@ function setCommentAnonymous($level) {
* Comments per page value.
* Comments per page value.
*/
*/
function
setCommentsPerPage
(
$number
)
{
function
setCommentsPerPage
(
$number
)
{
$this
->
setCommentSettings
(
'comment_default_per_page'
,
$number
,
'Number of comments per page set to
'
.
$
number
.
'.'
);
$this
->
setCommentSettings
(
'comment_default_per_page'
,
$number
,
format_string
(
'Number of comments per page set to
@
number
.'
,
array
(
'@number'
=>
$number
))
);
}
}
/**
/**
...
@@ -225,7 +225,7 @@ function setCommentsPerPage($number) {
...
@@ -225,7 +225,7 @@ function setCommentsPerPage($number) {
function
setCommentSettings
(
$name
,
$value
,
$message
)
{
function
setCommentSettings
(
$name
,
$value
,
$message
)
{
variable_set
(
$name
.
'_article'
,
$value
);
variable_set
(
$name
.
'_article'
,
$value
);
// Display status message.
// Display status message.
$this
->
ass
ertTrue
(
TRUE
,
$message
);
$this
->
p
ass
(
$message
);
}
}
/**
/**
...
...
core/modules/comment/lib/Drupal/comment/Tests/CommentThreadingTest.php
View file @
3fce22c5
...
@@ -29,7 +29,7 @@ function testCommentThreading() {
...
@@ -29,7 +29,7 @@ function testCommentThreading() {
$this
->
setCommentPreview
(
DRUPAL_DISABLED
);
$this
->
setCommentPreview
(
DRUPAL_DISABLED
);
$this
->
setCommentForm
(
TRUE
);
$this
->
setCommentForm
(
TRUE
);
$this
->
setCommentSubject
(
TRUE
);
$this
->
setCommentSubject
(
TRUE
);
$this
->
setCommentSettings
(
'comment_default_mode'
,
COMMENT_MODE_THREADED
,
t
(
'Comment paging changed.'
)
)
;
$this
->
setCommentSettings
(
'comment_default_mode'
,
COMMENT_MODE_THREADED
,
'Comment paging changed.'
);
$this
->
drupalLogout
();
$this
->
drupalLogout
();
// Create a node.
// Create a node.
...
...
core/modules/rdf/lib/Drupal/rdf/Tests/CommentAttributesTest.php
View file @
3fce22c5
...
@@ -46,7 +46,7 @@ public function setUp() {
...
@@ -46,7 +46,7 @@ public function setUp() {
$this
->
setCommentPreview
(
DRUPAL_OPTIONAL
);
$this
->
setCommentPreview
(
DRUPAL_OPTIONAL
);
$this
->
setCommentForm
(
TRUE
);
$this
->
setCommentForm
(
TRUE
);
$this
->
setCommentSubject
(
TRUE
);
$this
->
setCommentSubject
(
TRUE
);
$this
->
setCommentSettings
(
'comment_default_mode'
,
COMMENT_MODE_THREADED
,
t
(
'Comment paging changed.'
)
)
;
$this
->
setCommentSettings
(
'comment_default_mode'
,
COMMENT_MODE_THREADED
,
'Comment paging changed.'
);
// Creates the nodes on which the test comments will be posted.
// Creates the nodes on which the test comments will be posted.
$this
->
drupalLogin
(
$this
->
web_user
);
$this
->
drupalLogin
(
$this
->
web_user
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment