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
3de51022
Commit
3de51022
authored
May 08, 2014
by
catch
Browse files
Issue
#2254195
by sun: Fix test performance of Drupal\search\Tests\SearchCommentCountToggleTest.
parent
9ce59739
Changes
1
Hide whitespace changes
Inline
Side-by-side
core/modules/search/lib/Drupal/search/Tests/SearchCommentCountToggleTest.php
View file @
3de51022
...
...
@@ -26,10 +26,7 @@ class SearchCommentCountToggleTest extends SearchTestBase {
*
* @var array
*/
public
static
$modules
=
array
(
'comment'
);
// Requires node types, comment config, filter formats.
protected
$profile
=
'standard'
;
public
static
$modules
=
array
(
'node'
,
'comment'
);
protected
$searching_user
;
protected
$searchable_nodes
;
...
...
@@ -46,7 +43,7 @@ function setUp() {
parent
::
setUp
();
// Create searching user.
$this
->
searching_user
=
$this
->
drupalCreateUser
(
array
(
'search content'
,
'access content'
,
'access comments'
,
'skip comment approval'
));
$this
->
searching_user
=
$this
->
drupalCreateUser
(
array
(
'search content'
,
'access content'
,
'access comments'
,
'post comments'
,
'skip comment approval'
));
// Login with sufficient privileges.
$this
->
drupalLogin
(
$this
->
searching_user
);
...
...
@@ -84,9 +81,10 @@ function testSearchCommentCountToggle() {
$edit
=
array
(
'keys'
=>
"'SearchCommentToggleTestCase'"
,
);
$this
->
drupalGet
(
'search/node'
);
// Test comment count display for nodes with comment status set to Open
$this
->
submitGe
tForm
(
''
,
$edit
,
t
(
'Search'
));
$this
->
drupalPos
tForm
(
NULL
,
$edit
,
t
(
'Search'
));
$this
->
assertText
(
t
(
'0 comments'
),
'Empty comment count displays for nodes with comment status set to Open'
);
$this
->
assertText
(
t
(
'1 comment'
),
'Non-empty comment count displays for nodes with comment status set to Open'
);
...
...
@@ -96,7 +94,7 @@ function testSearchCommentCountToggle() {
$this
->
searchable_nodes
[
'1 comment'
]
->
set
(
'comment'
,
CommentItemInterface
::
CLOSED
);
$this
->
searchable_nodes
[
'1 comment'
]
->
save
();
$this
->
submitGe
tForm
(
''
,
$edit
,
t
(
'Search'
));
$this
->
drupalPos
tForm
(
NULL
,
$edit
,
t
(
'Search'
));
$this
->
assertNoText
(
t
(
'0 comments'
),
'Empty comment count does not display for nodes with comment status set to Closed'
);
$this
->
assertText
(
t
(
'1 comment'
),
'Non-empty comment count displays for nodes with comment status set to Closed'
);
...
...
@@ -106,7 +104,7 @@ function testSearchCommentCountToggle() {
$this
->
searchable_nodes
[
'1 comment'
]
->
set
(
'comment'
,
CommentItemInterface
::
HIDDEN
);
$this
->
searchable_nodes
[
'1 comment'
]
->
save
();
$this
->
submitGe
tForm
(
''
,
$edit
,
t
(
'Search'
));
$this
->
drupalPos
tForm
(
NULL
,
$edit
,
t
(
'Search'
));
$this
->
assertNoText
(
t
(
'0 comments'
),
'Empty comment count does not display for nodes with comment status set to Hidden'
);
$this
->
assertNoText
(
t
(
'1 comment'
),
'Non-empty comment count does not display for nodes with comment status set to Hidden'
);
}
...
...
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