function AssertLegacyTrait::assertRaw

Same name in other branches
  1. 8.9.x core/tests/Drupal/FunctionalTests/AssertLegacyTrait.php \Drupal\FunctionalTests\AssertLegacyTrait::assertRaw()

Passes if the raw text IS found on the loaded page, fail otherwise.

Raw text refers to the raw HTML that the page generated.

Parameters

string $raw: Raw (HTML) string to look for.

Deprecated

in drupal:8.2.0 and is removed from drupal:10.0.0. Use $this->assertSession()->responseContains() instead.

See also

https://www.drupal.org/node/3129738

1 call to AssertLegacyTrait::assertRaw()
AssertLegacyTraitTest::testAssertRaw in core/tests/Drupal/Tests/Core/Assert/AssertLegacyTraitTest.php
@covers ::assertRaw

File

core/tests/Drupal/FunctionalTests/AssertLegacyTrait.php, line 383

Class

AssertLegacyTrait
Provides convenience methods for assertions in browser tests.

Namespace

Drupal\FunctionalTests

Code

protected function assertRaw($raw) {
    @trigger_error('AssertLegacyTrait::assertRaw() is deprecated in drupal:8.2.0 and is removed from drupal:10.0.0. Use $this->assertSession()->responseContains() instead. See https://www.drupal.org/node/3129738', E_USER_DEPRECATED);
    if (func_num_args() > 1) {
        @trigger_error('Calling AssertLegacyTrait::assertRaw() with more that one argument is deprecated in drupal:8.2.0 and the method is removed from drupal:10.0.0. Use $this->assertSession()->responseContains() instead. See https://www.drupal.org/node/3129738', E_USER_DEPRECATED);
    }
    $this->assertSession()
        ->responseContains($raw);
}

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