You are here

protected function IntegrationTest::assertHtmlEscaped in Search API 8

Ensures that all occurrences of the string are properly escaped.

This makes sure that the string is only mentioned in an escaped version and is never double escaped.

Parameters

string $string: The raw string to check for.

3 calls to IntegrationTest::assertHtmlEscaped()
IntegrationTest::checkFieldLabels in tests/src/Functional/IntegrationTest.php
Tests that field labels are always properly escaped.
IntegrationTest::createIndex in tests/src/Functional/IntegrationTest.php
Tests creating a search index via the UI.
IntegrationTest::createServer in tests/src/Functional/IntegrationTest.php
Tests creating a search server via the UI.

File

tests/src/Functional/IntegrationTest.php, line 1634

Class

IntegrationTest
Tests the overall functionality of the Search API framework and admin UI.

Namespace

Drupal\Tests\search_api\Functional

Code

protected function assertHtmlEscaped($string) {
  $this
    ->assertSession()
    ->responseContains(Html::escape($string));
  $this
    ->assertSession()
    ->responseNotContains(Html::escape(Html::escape($string)));
  $this
    ->assertSession()
    ->responseNotContains($string);
}