function CommentStatusFieldAccessTest::testCommentStatusFieldAccessStatus
Tests comment status field access.
File
- 
              core/modules/ comment/ tests/ src/ Functional/ CommentStatusFieldAccessTest.php, line 86 
Class
- CommentStatusFieldAccessTest
- Tests comment status field access.
Namespace
Drupal\Tests\comment\FunctionalCode
public function testCommentStatusFieldAccessStatus() {
  $this->drupalLogin($this->nodeAuthor);
  $this->drupalGet('node/add/article');
  $assert = $this->assertSession();
  $assert->fieldNotExists('comment[0][status]');
  $this->submitForm([
    'title[0][value]' => 'Node 1',
  ], 'Save');
  $assert->fieldExists('subject[0][value]');
  $this->drupalLogin($this->commentAdmin);
  $this->drupalGet('node/add/article');
  $assert->fieldExists('comment[0][status]');
  $this->submitForm([
    'title[0][value]' => 'Node 2',
  ], 'Save');
  $assert->fieldExists('subject[0][value]');
}Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.
