function RequestSanitizerTest::testRequestSanitization

Same name in other branches
  1. 9 core/tests/Drupal/Tests/Core/Security/RequestSanitizerTest.php \Drupal\Tests\Core\Security\RequestSanitizerTest::testRequestSanitization()
  2. 8.9.x core/tests/Drupal/Tests/Core/Security/RequestSanitizerTest.php \Drupal\Tests\Core\Security\RequestSanitizerTest::testRequestSanitization()
  3. 10 core/tests/Drupal/Tests/Core/Security/RequestSanitizerTest.php \Drupal\Tests\Core\Security\RequestSanitizerTest::testRequestSanitization()
  4. 11.x core/tests/Drupal/Tests/Core/Security/RequestSanitizerTest.php \Drupal\Tests\Core\Security\RequestSanitizerTest::testRequestSanitization()

Iterate through all the RequestSanitizerTests.

File

modules/simpletest/tests/request_sanitizer.test, line 43

Class

RequestSanitizerTest
Tests DrupalRequestSanitizer class.

Code

public function testRequestSanitization() {
    foreach ($this->requestSanitizerTests() as $label => $data) {
        $this->errors = array();
        // Normalize the test parameters.
        $test = array(
            'request' => $data[0],
            'expected' => isset($data[1]) ? $data[1] : array(),
            'expected_errors' => isset($data[2]) ? $data[2] : NULL,
            'whitelist' => isset($data[3]) ? $data[3] : array(),
        );
        $this->requestSanitizationTest($test['request'], $test['expected'], $test['expected_errors'], $test['whitelist'], $label);
    }
}

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