You are here

protected function LinkFieldUITest::assertFieldContainsRawText in Drupal 8

Same name and namespace in other branches
  1. 9 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)));
}