function RESTTestBase::drupalGetHeaders

Overrides WebTestBase::drupalGetHeaders

File

core/modules/rest/src/Tests/RESTTestBase.php, line 260

Class

RESTTestBase
Test helper class that provides a REST client method to send HTTP requests.

Namespace

Drupal\rest\Tests

Code

protected function drupalGetHeaders($all_requests = FALSE) {
    if (!isset($this->response)) {
        return parent::drupalGetHeaders($all_requests);
    }
    $lowercased_keys = array_map('strtolower', array_keys($this->response
        ->getHeaders()));
    return array_map(function (array $header) {
        return implode(', ', $header);
    }, array_combine($lowercased_keys, array_values($this->response
        ->getHeaders())));
}

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