function LinkFieldUITest::assertFieldContainsRawText

Same name in other branches
  1. 9 core/modules/link/tests/src/Functional/LinkFieldUITest.php \Drupal\Tests\link\Functional\LinkFieldUITest::assertFieldContainsRawText()
  2. 10 core/modules/link/tests/src/Functional/LinkFieldUITest.php \Drupal\Tests\link\Functional\LinkFieldUITest::assertFieldContainsRawText()
  3. 11.x core/modules/link/tests/src/Functional/LinkFieldUITest.php \Drupal\Tests\link\Functional\LinkFieldUITest::assertFieldContainsRawText()

Checks that given field contains the given raw text.

Parameters

string $field_name: The name of the field to check.

string $text: The text to check.

1 call to LinkFieldUITest::assertFieldContainsRawText()
LinkFieldUITest::runFieldUIItem in core/modules/link/tests/src/Functional/LinkFieldUITest.php
Tests one link field UI item.

File

core/modules/link/tests/src/Functional/LinkFieldUITest.php, line 238

Class

LinkFieldUITest
Tests link field UI functionality.

Namespace

Drupal\Tests\link\Functional

Code

protected function assertFieldContainsRawText($field_name, $text) {
    $this->assertTrue((bool) preg_match('/' . preg_quote($text, '/') . '/ui', $this->getFieldHtml($field_name)));
}

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