You are here

public function CommentTestBase::setCommentSettings in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/comment/src/Tests/CommentTestBase.php \Drupal\comment\Tests\CommentTestBase::setCommentSettings()

Sets a comment settings variable for the article content type.

Parameters

string $name: Name of variable.

string $value: Value of variable.

string $message: Status message to display.

string $field_name: (optional) Field name through which the comment should be posted. Defaults to 'comment'.

17 calls to CommentTestBase::setCommentSettings()
CommentAttributesTest::setUp in core/modules/rdf/src/Tests/CommentAttributesTest.php
Sets up a Drupal site for running functional and integration tests.
CommentInterfaceTest::setUp in core/modules/comment/src/Tests/CommentInterfaceTest.php
Set up comments to have subject and preview disabled.
CommentLinksTest::testCommentLinks in core/modules/comment/src/Tests/CommentLinksTest.php
Tests that comment links are output and can be hidden.
CommentNodeAccessTest::testThreadedCommentView in core/modules/comment/src/Tests/CommentNodeAccessTest.php
Test that threaded comments can be viewed.
CommentPagerTest::testCommentNewPageIndicator in core/modules/comment/src/Tests/CommentPagerTest.php
Tests calculation of first page with new comment.

... See full list

File

core/modules/comment/src/Tests/CommentTestBase.php, line 327
Contains \Drupal\comment\Tests\CommentTestBase.

Class

CommentTestBase
Provides setup and helper methods for comment tests.

Namespace

Drupal\comment\Tests

Code

public function setCommentSettings($name, $value, $message, $field_name = 'comment') {
  $field = FieldConfig::loadByName('node', 'article', $field_name);
  $field
    ->setSetting($name, $value);
  $field
    ->save();

  // Display status message.
  $this
    ->pass($message);
}