function RequestSanitizerTest::assertError
Same name in other branches
- 7.x modules/simpletest/tests/request_sanitizer.test \RequestSanitizerTest::assertError()
- 9 core/tests/Drupal/Tests/Core/Security/RequestSanitizerTest.php \Drupal\Tests\Core\Security\RequestSanitizerTest::assertError()
- 10 core/tests/Drupal/Tests/Core/Security/RequestSanitizerTest.php \Drupal\Tests\Core\Security\RequestSanitizerTest::assertError()
- 11.x core/tests/Drupal/Tests/Core/Security/RequestSanitizerTest.php \Drupal\Tests\Core\Security\RequestSanitizerTest::assertError()
Asserts that the expected error has been logged.
Parameters
string $errstr: The error message.
int $errno: The severity level of the error.
3 calls to RequestSanitizerTest::assertError()
- RequestSanitizerTest::testRequestSanitization in core/
tests/ Drupal/ Tests/ Core/ Security/ RequestSanitizerTest.php - Tests RequestSanitizer class.
- RequestSanitizerTest::testSanitizedDestinationGet in core/
tests/ Drupal/ Tests/ Core/ Security/ RequestSanitizerTest.php - Tests unacceptable destinations are removed from GET requests.
- RequestSanitizerTest::testSanitizedDestinationPost in core/
tests/ Drupal/ Tests/ Core/ Security/ RequestSanitizerTest.php - Tests unacceptable destinations are removed from GET requests.
File
-
core/
tests/ Drupal/ Tests/ Core/ Security/ RequestSanitizerTest.php, line 361
Class
- RequestSanitizerTest
- Tests RequestSanitizer class.
Namespace
Drupal\Tests\Core\SecurityCode
protected function assertError($errstr, $errno) {
foreach ($this->errors as $error) {
if ($error['errstr'] === $errstr && $error['errno'] === $errno) {
return;
}
}
$this->fail("Error with level {$errno} and message '{$errstr}' not found in " . var_export($this->errors, TRUE));
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.