Leo assertions for testing HttpFoundation applications

1.1.0 2015-02-10 18:03 UTC

This package is not auto-updated.

Last update: 2024-05-21 02:12:26 UTC


#Leo Http Foundation

Leo assertions for use with HttpFoundation

Build Status Scrutinizer Code Quality

This set of assertions is evolving as needed. Please feel free to submit pull requests and make feature requests.


You can add HttpFoundation behavior to Leo by extending the Leo assertion property.

$assertion = Leo::assertion();
$assertion->extend(new LeoHttpFoundation());


###->allow(methods, [message])

  • @param array $methods
  • @param string $message [optional]

Checks that the Allowed header is present on the response and that it contains all values passed in the methods array.

expect($response)->to->allow(['POST', 'GET']);

###->status(status, [message])

  • @param int $status
  • @param string $message [optional]

Asserts that the response status is equal to status.



  • @param bool $assoc [optional]
  • @param int $depth [optional]
  • @param int $options [optional]

A language chain that parses the response body as json and sets it as the subject of the assertion chain. The options parameters for json_decode() may also be included.

expect($response)->json(true, 999, JSON_BIGINT_AS_STRING)->to->equal($expected);