You are here

public function CommentOperationsTest::testCommentOperations in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/comment/src/Tests/Views/CommentOperationsTest.php \Drupal\comment\Tests\Views\CommentOperationsTest::testCommentOperations()

Test the operations field plugin.

File

core/modules/comment/src/Tests/Views/CommentOperationsTest.php, line 27
Contains \Drupal\comment\Tests\Views\CommentOperationsTest.

Class

CommentOperationsTest
Tests comment operations.

Namespace

Drupal\comment\Tests\Views

Code

public function testCommentOperations() {
  $admin_account = $this
    ->drupalCreateUser([
    'administer comments',
  ]);
  $this
    ->drupalLogin($admin_account);
  $this
    ->drupalGet('test-comment-operations');
  $this
    ->assertResponse(200);
  $operation = $this
    ->cssSelect('.views-field-operations li.edit a');
  $this
    ->assertEqual(count($operation), 1, 'Found edit operation for comment.');
  $operation = $this
    ->cssSelect('.views-field-operations li.delete a');
  $this
    ->assertEqual(count($operation), 1, 'Found delete operation for comment.');
}