class CommentLinksAlterTest
Same name and namespace in other branches
- 11.x core/modules/comment/tests/src/Functional/CommentLinksAlterTest.php \Drupal\Tests\comment\Functional\CommentLinksAlterTest
Tests comment links altering.
@group comment
Hierarchy
- class \Drupal\Tests\BrowserTestBase uses \Drupal\Core\Test\FunctionalTestSetupTrait, \Drupal\Tests\UiHelperTrait, \Drupal\Core\Test\TestSetupTrait, \Drupal\Tests\block\Traits\BlockCreationTrait, \Drupal\FunctionalTests\AssertLegacyTrait, \Drupal\Tests\RandomGeneratorTrait, \Drupal\Tests\node\Traits\NodeCreationTrait, \Drupal\Tests\node\Traits\ContentTypeCreationTrait, \Drupal\Tests\ConfigTestTrait, \Drupal\Tests\TestRequirementsTrait, \Drupal\Tests\user\Traits\UserCreationTrait, \Drupal\Tests\XdebugRequestTrait, \Drupal\Tests\Traits\PhpUnitWarnings, \Drupal\Tests\PhpUnitCompatibilityTrait, \Symfony\Bridge\PhpUnit\ExpectDeprecationTrait, \Drupal\Tests\ExtensionListTestTrait implements \PHPUnit\Framework\TestCase
- class \Drupal\Tests\comment\Functional\CommentTestBase uses \Drupal\comment\Tests\CommentTestTrait implements \Drupal\Tests\BrowserTestBase
- class \Drupal\Tests\comment\Functional\CommentLinksAlterTest implements \Drupal\Tests\comment\Functional\CommentTestBase
- class \Drupal\Tests\comment\Functional\CommentTestBase uses \Drupal\comment\Tests\CommentTestTrait implements \Drupal\Tests\BrowserTestBase
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';
/**
* {@inheritdoc}
*/
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');
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.