Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
a29f2d14
Commit
a29f2d14
authored
Oct 18, 2012
by
webchick
Browse files
Issue
#1814868
by xjm: Convert remaining comment tests to the testing profile.
parent
711ed2ad
Changes
6
Hide whitespace changes
Inline
Side-by-side
core/modules/comment/lib/Drupal/comment/Tests/CommentAnonymousTest.php
View file @
a29f2d14
...
...
@@ -12,15 +12,6 @@
*/
class
CommentAnonymousTest
extends
CommentTestBase
{
/**
* Use the standard profile.
*
* @var string
*
* @todo Remove this dependency if possible.
*/
protected
$profile
=
'standard'
;
public
static
function
getInfo
()
{
return
array
(
'name'
=>
'Anonymous comments'
,
...
...
@@ -32,6 +23,18 @@ public static function getInfo() {
function
setUp
()
{
parent
::
setUp
();
config
(
'user.settings'
)
->
set
(
'register'
,
USER_REGISTER_VISITORS
)
->
save
();
// Enable anonymous and authenticated user comments.
user_role_grant_permissions
(
DRUPAL_ANONYMOUS_RID
,
array
(
'access comments'
,
'post comments'
,
'skip comment approval'
,
));
user_role_grant_permissions
(
DRUPAL_AUTHENTICATED_RID
,
array
(
'access comments'
,
'post comments'
,
'skip comment approval'
,
));
}
/**
...
...
@@ -39,12 +42,6 @@ function setUp() {
*/
function
testAnonymous
()
{
$this
->
drupalLogin
(
$this
->
admin_user
);
// Enabled anonymous user comments.
user_role_change_permissions
(
DRUPAL_ANONYMOUS_RID
,
array
(
'access comments'
=>
TRUE
,
'post comments'
=>
TRUE
,
'skip comment approval'
=>
TRUE
,
));
$this
->
setCommentAnonymous
(
'0'
);
// Ensure that doesn't require contact info.
$this
->
drupalLogout
();
...
...
core/modules/comment/lib/Drupal/comment/Tests/CommentCSSTest.php
View file @
a29f2d14
...
...
@@ -12,16 +12,6 @@
*/
class
CommentCSSTest
extends
CommentTestBase
{
/**
* Use the standard profile.
*
* @var string
*
* @todo Are these dependent on a particular theme? Remove this dependency
* if possible.
*/
protected
$profile
=
'standard'
;
public
static
function
getInfo
()
{
return
array
(
'name'
=>
'Comment CSS'
,
...
...
@@ -30,6 +20,16 @@ public static function getInfo() {
);
}
function
setUp
()
{
parent
::
setUp
();
// Allow anonymous users to see comments.
user_role_grant_permissions
(
DRUPAL_ANONYMOUS_RID
,
array
(
'access comments'
,
'access content'
));
}
/**
* Tests CSS classes on comments.
*/
...
...
core/modules/comment/lib/Drupal/comment/Tests/CommentLinksTest.php
View file @
a29f2d14
...
...
@@ -12,15 +12,6 @@
*/
class
CommentLinksTest
extends
CommentTestBase
{
/**
* Use the standard profile.
*
* @var string
*
* @todo Remove this dependency.
*/
protected
$profile
=
'standard'
;
public
static
function
getInfo
()
{
return
array
(
'name'
=>
'Comment links'
,
...
...
@@ -220,7 +211,7 @@ function assertCommentLinks(array $info) {
$nid
=
$this
->
node
->
nid
;
foreach
(
array
(
''
,
"node/
$nid
"
)
as
$path
)
{
foreach
(
array
(
'
node
'
,
"node/
$nid
"
)
as
$path
)
{
$this
->
drupalGet
(
$path
);
// User is allowed to view comments.
...
...
core/modules/comment/lib/Drupal/comment/Tests/CommentNewIndicatorTest.php
View file @
a29f2d14
...
...
@@ -12,15 +12,6 @@
*/
class
CommentNewIndicatorTest
extends
CommentTestBase
{
/**
* Use the standard profile.
*
* @var string
*
* @todo Remove this dependency.
*/
protected
$profile
=
'standard'
;
public
static
function
getInfo
()
{
return
array
(
'name'
=>
"Comment 'new' indicator"
,
...
...
@@ -41,8 +32,6 @@ public function testCommentNewCommentsIndicator() {
$this
->
assertNoLink
(
t
(
'@count comments'
,
array
(
'@count'
=>
0
)));
$this
->
assertNoLink
(
t
(
'@count new comments'
,
array
(
'@count'
=>
0
)));
$this
->
assertLink
(
t
(
'Read more'
));
$count
=
$this
->
xpath
(
'//div[@id=:id]/div[@class=:class]/ul/li'
,
array
(
':id'
=>
'node-'
.
$this
->
node
->
nid
,
':class'
=>
'link-wrapper'
));
$this
->
assertTrue
(
count
(
$count
)
==
1
,
'One child found'
);
// Create a new comment. This helper function may be run with different
// comment settings so use comment_save() to avoid complex setup.
...
...
@@ -75,8 +64,6 @@ public function testCommentNewCommentsIndicator() {
$this
->
assertLink
(
t
(
'Read more'
));
$this
->
assertNoLink
(
t
(
'1 new comment'
));
$this
->
assertNoLink
(
t
(
'@count new comments'
,
array
(
'@count'
=>
0
)));
$count
=
$this
->
xpath
(
'//div[@id=:id]/div[@class=:class]/ul/li'
,
array
(
':id'
=>
'node-'
.
$this
->
node
->
nid
,
':class'
=>
'link-wrapper'
));
$this
->
assertTrue
(
count
(
$count
)
==
2
,
print_r
(
$count
,
TRUE
));
}
}
core/modules/comment/lib/Drupal/comment/Tests/CommentStatisticsTest.php
View file @
a29f2d14
...
...
@@ -12,15 +12,6 @@
*/
class
CommentStatisticsTest
extends
CommentTestBase
{
/**
* Use the standard profile.
*
* @var string
*
* @todo Remove this dependency.
*/
protected
$profile
=
'standard'
;
public
static
function
getInfo
()
{
return
array
(
'name'
=>
'Comment statistics'
,
...
...
@@ -29,6 +20,21 @@ public static function getInfo() {
);
}
function
setUp
()
{
parent
::
setUp
();
// Create a second user to post comments.
$this
->
web_user2
=
$this
->
drupalCreateUser
(
array
(
'post comments'
,
'create article content'
,
'edit own comments'
,
'post comments'
,
'skip comment approval'
,
'access comments'
,
'access content'
,
));
}
/**
* Tests the node comment statistics.
*/
...
...
@@ -42,9 +48,6 @@ function testCommentNodeCommentStatistics() {
$this
->
setCommentSettings
(
'comment_default_mode'
,
COMMENT_MODE_THREADED
,
'Comment paging changed.'
);
$this
->
drupalLogout
();
// Creates a second user to post comments.
$this
->
web_user2
=
$this
->
drupalCreateUser
(
array
(
'access comments'
,
'post comments'
,
'create article content'
,
'edit own comments'
));
// Checks the initial values of node comment statistics with no comment.
$node
=
node_load
(
$this
->
node
->
nid
);
$this
->
assertEqual
(
$node
->
last_comment_timestamp
,
$this
->
node
->
created
,
'The initial value of node last_comment_timestamp is the node created date.'
);
...
...
core/modules/comment/lib/Drupal/comment/Tests/CommentTestBase.php
View file @
a29f2d14
...
...
@@ -69,7 +69,6 @@ function setUp() {
'edit own comments'
,
'post comments'
,
'skip comment approval'
,
'access comments'
,
'access content'
,
));
...
...
Write
Preview
Supports
Markdown
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