class CommentEditTest
Same name and namespace in other branches
- 11.x core/modules/comment/tests/src/Functional/Views/CommentEditTest.php \Drupal\Tests\comment\Functional\Views\CommentEditTest
Tests comment edit functionality.
@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\Views\CommentEditTest 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 CommentEditTest
File
-
core/
modules/ comment/ tests/ src/ Functional/ Views/ CommentEditTest.php, line 12
Namespace
Drupal\Tests\comment\Functional\ViewsView source
class CommentEditTest extends CommentBrowserTestBase {
/**
* {@inheritdoc}
*/
protected $defaultTheme = 'stark';
/**
* Tests comment label in admin view.
*/
public function testCommentEdit() {
$this->drupalLogin($this->adminUser);
// Post a comment to node.
$node_comment = $this->postComment($this->node, $this->randomMachineName(), $this->randomMachineName(), TRUE);
$this->drupalGet('admin/content/comment');
$this->assertSession()
->pageTextContains($this->adminUser
->label());
$this->drupalGet($node_comment->toUrl('edit-form'));
$edit = [
'comment_body[0][value]' => $this->randomMachineName(),
];
$this->submitForm($edit, 'Save');
$this->drupalGet('admin/content/comment');
$this->assertSession()
->pageTextContains($this->adminUser
->label());
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.