class CommentLinksAlterTest in Drupal 10
Same name and namespace in other branches
- 8 core/modules/comment/tests/src/Functional/CommentLinksAlterTest.php \Drupal\Tests\comment\Functional\CommentLinksAlterTest
- 9 core/modules/comment/tests/src/Functional/CommentLinksAlterTest.php \Drupal\Tests\comment\Functional\CommentLinksAlterTest
Tests comment links altering.
@group comment
Hierarchy
- class \Drupal\Tests\BrowserTestBase extends \PHPUnit\Framework\TestCase uses \Drupal\Tests\PhpUnitCompatibilityTrait, \Symfony\Bridge\PhpUnit\ExpectDeprecationTrait, FunctionalTestSetupTrait, TestSetupTrait, BlockCreationTrait, ConfigTestTrait, ExtensionListTestTrait, ContentTypeCreationTrait, NodeCreationTrait, RandomGeneratorTrait, TestRequirementsTrait, PhpUnitWarnings, UiHelperTrait, UserCreationTrait, XdebugRequestTrait
- class \Drupal\Tests\comment\Functional\CommentTestBase uses CommentTestTrait
- class \Drupal\Tests\comment\Functional\CommentLinksAlterTest
- class \Drupal\Tests\comment\Functional\CommentTestBase uses CommentTestTrait
Expanded class hierarchy of CommentLinksAlterTest
File
- core/
modules/ comment/ tests/ src/ Functional/ CommentLinksAlterTest.php, line 10
Namespace
Drupal\Tests\comment\FunctionalView source
class CommentLinksAlterTest extends CommentTestBase {
protected static $modules = [
'comment_test',
];
/**
* {@inheritdoc}
*/
protected $defaultTheme = 'stark';
protected function setUp() : void {
parent::setUp();
// Enable comment_test.module's hook_comment_links_alter() implementation.
$this->container
->get('state')
->set('comment_test_links_alter_enabled', TRUE);
}
/**
* Tests comment links altering.
*/
public function testCommentLinksAlter() {
$this
->drupalLogin($this->webUser);
$comment_text = $this
->randomMachineName();
$subject = $this
->randomMachineName();
$this
->postComment($this->node, $comment_text, $subject);
$this
->drupalGet('node/' . $this->node
->id());
$this
->assertSession()
->linkExists('Report');
}
}