public function theServerShouldReturnHeaders(TableNode $headers)
    {
        Assertions::assertNotNull($this->response, 'Missing response. Can you not send request?');
        $responseHeaders = [];

        foreach ($this->response->getHeaders() as $name => $value) {
            $responseHeaders[strtolower($name)] = $value;
        }

        foreach ($headers->getRowsHash() as $headerName => $headerValue) {
            $headerName = strtolower($headerName);

            Assertions::assertArrayHasKey($headerName, $responseHeaders, 'Missing header in response.');

            $responseHeader = $responseHeaders[$headerName];
            $responseHeader = implode('; ', $responseHeader);

            Assertions::assertEquals($headerValue, $responseHeader, 'The header is not equals.');
        }
    }
public function theServerShouldReturnHeaders(TableNode $headers)
    {
        Assertions::assertNotNull($this->response, 'Missing response. Can you not send request?');
        $responseHeaders = [];

        foreach ($this->response->getHeaders() as $name => $value) {
            $responseHeaders[strtolower($name)] = $value;
        }

        foreach ($headers->getRowsHash() as $headerName => $headerValue) {
            $headerName = strtolower($headerName);

            Assertions::assertArrayHasKey($headerName, $responseHeaders, 'Missing header in response.');

            $responseHeader = $responseHeaders[$headerName];
            $responseHeader = implode('; ', $responseHeader);

            Assertions::assertEquals($headerValue, $responseHeader, 'The header is not equals.');
        }
    }
public function theServerShouldReturnHeaders ( TableNode $ headers ) { Assertions :: assertNotNull ( $ this -> response , 'Missing response. Can you not send request?' ) ; $ responseHeaders = [ ] ; foreach ( $ this -> response -> getHeaders ( ) as $ name => $ value ) { $ responseHeaders [ strtolower ( $ name ) ] = $ value ; } foreach ( $ headers -> getRowsHash ( ) as $ headerName => $ headerValue ) { $ headerName = strtolower ( $ headerName ) ; Assertions :: assertArrayHasKey ( $ headerName , $ responseHeaders , 'Missing header in response.' ) ; $ responseHeader = $ responseHeaders [ $ headerName ] ; $ responseHeader = implode ( '; ' , $ responseHeader ) ; Assertions :: assertEquals ( $ headerValue , $ responseHeader , 'The header is not equals.' ) ; } }
The server should return headers

@param TableNode $headers

@Then /^(?:the )?server should return headers:$/
The server should return headers