"comment_bulk_form[0]" =>
$comments[1
]->
id(),
];
$this->
submitForm($edit, 'Apply to selected items'
);
$this->
assertSession()->
pageTextContains('Unapproved comments (0)'
);
// Test message when no comments selected.
$this->
drupalGet('admin/content/comment'
);
$this->
submitForm([], 'Apply to selected items'
);
$this->
assertSession()->
pageTextContains('Select one or more comments to perform the update on.'
);
// Test that comment listing shows the correct subject link.
$this->
assertSession()->
elementExists('xpath',
$this->
assertSession()->
buildXPathQuery('//table/tbody/tr/td/a[contains(@href, :href) and contains(@title, :title) and text()=:text]',
[ ':href' =>
$comments[0
]->
permalink()->
toString(),
':title' => Unicode::
truncate($comments[0
]->
get('comment_body'
)->value, 128
),
':text' =>
$comments[0
]->
getSubject(),
]));
// Verify that anonymous author name is displayed correctly.
$this->
assertSession()->
pageTextContains($author_name . ' (not verified)'
);
// Test that comment listing shows the correct subject link.
$this->
assertSession()->
elementExists('xpath',
$this->
assertSession()->
buildXPathQuery('//table/tbody/tr/td/a[contains(@href, :href) and contains(@title, :title) and text()=:text]',
[ ':href' =>
$anonymous_comment4->
permalink()->
toString(),