function CommentNonNodeTest::commentContactInfoAvailable

Same name and namespace in other branches
  1. 9 core/modules/comment/tests/src/Functional/CommentNonNodeTest.php \Drupal\Tests\comment\Functional\CommentNonNodeTest::commentContactInfoAvailable()
  2. 8.9.x core/modules/comment/tests/src/Functional/CommentNonNodeTest.php \Drupal\Tests\comment\Functional\CommentNonNodeTest::commentContactInfoAvailable()
  3. 10 core/modules/comment/tests/src/Functional/CommentNonNodeTest.php \Drupal\Tests\comment\Functional\CommentNonNodeTest::commentContactInfoAvailable()

Checks whether the commenter's contact information is displayed.

Return value

bool Contact info is available.

File

core/modules/comment/tests/src/Functional/CommentNonNodeTest.php, line 219

Class

CommentNonNodeTest
Tests commenting on a test entity.

Namespace

Drupal\Tests\comment\Functional

Code

public function commentContactInfoAvailable() {
    return (bool) preg_match('/(input).*?(name="name").*?(input).*?(name="mail").*?(input).*?(name="homepage")/s', $this->getSession()
        ->getPage()
        ->getContent());
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.