comparison core/modules/search/tests/src/Functional/SearchCommentCountToggleTest.php @ 4:a9cd425dd02b

Update, including to Drupal core 8.6.10
author Chris Cannam
date Thu, 28 Feb 2019 13:11:55 +0000
parents c75dbcec494b
children
comparison
equal deleted inserted replaced
3:307d7a7fd348 4:a9cd425dd02b
2 2
3 namespace Drupal\Tests\search\Functional; 3 namespace Drupal\Tests\search\Functional;
4 4
5 use Drupal\comment\Plugin\Field\FieldType\CommentItemInterface; 5 use Drupal\comment\Plugin\Field\FieldType\CommentItemInterface;
6 use Drupal\comment\Tests\CommentTestTrait; 6 use Drupal\comment\Tests\CommentTestTrait;
7 use Drupal\Tests\BrowserTestBase;
7 8
8 /** 9 /**
9 * Tests that comment count display toggles properly on comment status of node. 10 * Tests that comment count display toggles properly on comment status of node.
10 * 11 *
11 * Issue 537278 12 * Issue 537278
15 * only when there are comments 16 * only when there are comments
16 * - Nodes with comment status set to Hidden should never show comment counts 17 * - Nodes with comment status set to Hidden should never show comment counts
17 * 18 *
18 * @group search 19 * @group search
19 */ 20 */
20 class SearchCommentCountToggleTest extends SearchTestBase { 21 class SearchCommentCountToggleTest extends BrowserTestBase {
21 22
22 use CommentTestTrait; 23 use CommentTestTrait;
23 24
24 /** 25 /**
25 * Modules to enable. 26 * {@inheritdoc}
26 *
27 * @var array
28 */ 27 */
29 public static $modules = ['node', 'comment']; 28 protected static $modules = ['node', 'comment', 'search', 'dblog'];
30 29
31 /** 30 /**
32 * A user with permission to search and post comments. 31 * A user with permission to search and post comments.
33 * 32 *
34 * @var \Drupal\user\UserInterface 33 * @var \Drupal\user\UserInterface
42 */ 41 */
43 protected $searchableNodes; 42 protected $searchableNodes;
44 43
45 protected function setUp() { 44 protected function setUp() {
46 parent::setUp(); 45 parent::setUp();
46
47 $this->drupalCreateContentType(['type' => 'article', 'name' => 'Article']);
47 48
48 // Create searching user. 49 // Create searching user.
49 $this->searchingUser = $this->drupalCreateUser(['search content', 'access content', 'access comments', 'post comments', 'skip comment approval']); 50 $this->searchingUser = $this->drupalCreateUser(['search content', 'access content', 'access comments', 'post comments', 'skip comment approval']);
50 51
51 // Log in with sufficient privileges. 52 // Log in with sufficient privileges.