Skip to content

Commit

Permalink
Behat#6 Add step definition to access header values
Browse files Browse the repository at this point in the history
  • Loading branch information
laurieplociennik committed Oct 17, 2017
1 parent ff62c55 commit fde2f05
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/Context/WebApiContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,19 @@ public function theResponseCodeShouldBe($code)
Assertions::assertSame($expected, $actual);
}

/**
* Checks that the response has specific header key/value
*
* @param string $key header key
* @param string $value header value
*
* @Then the response header :key should be :value
*/
public function theResponseHeaderShouldBe($key, $value)
{
Assertions::assertSame($value, $this->response->getHeader($key)[0]);
}

/**
* Checks that response body contains specific text.
*
Expand Down

0 comments on commit fde2f05

Please sign in to comment.