CommentOperationsTest.php in Drupal 8
File
core/modules/comment/tests/src/Functional/Views/CommentOperationsTest.php
View source
<?php
namespace Drupal\Tests\comment\Functional\Views;
class CommentOperationsTest extends CommentTestBase {
public static $testViews = [
'test_comment_operations',
];
protected $defaultTheme = 'classy';
public function testCommentOperations() {
$admin_account = $this
->drupalCreateUser([
'administer comments',
]);
$this
->drupalLogin($admin_account);
$this
->drupalGet('test-comment-operations');
$this
->assertSession()
->statusCodeEquals(200);
$operation = $this
->cssSelect('.views-field-operations li.edit a');
$this
->assertCount(1, $operation, 'Found edit operation for comment.');
$operation = $this
->cssSelect('.views-field-operations li.delete a');
$this
->assertCount(1, $operation, 'Found delete operation for comment.');
}
}