PHPackages                             peridot-php/leo-http-foundation - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. peridot-php/leo-http-foundation

ActiveLibrary

peridot-php/leo-http-foundation
===============================

Leo assertions for testing HttpFoundation applications

1.1.0(11y ago)421.3k3[1 PRs](https://github.com/peridot-php/leo-http-foundation/pulls)MITPHPCI failing

Since Dec 21Pushed 6y ago2 watchersCompare

[ Source](https://github.com/peridot-php/leo-http-foundation)[ Packagist](https://packagist.org/packages/peridot-php/leo-http-foundation)[ RSS](/packages/peridot-php-leo-http-foundation/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (3)Versions (3)Used By (0)

\#Leo Http Foundation

[Leo](http://peridot-php.github.io/leo/) assertions for use with [HttpFoundation](http://symfony.com/doc/current/components/http_foundation/introduction.html)

[![Build Status](https://camo.githubusercontent.com/da368a52824f96e341bdd2437d29bdcf9e9e2a4051d75632508553e614a239f5/68747470733a2f2f7472617669732d63692e6f72672f70657269646f742d7068702f6c656f2d687474702d666f756e646174696f6e2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/peridot-php/leo-http-foundation)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/8aa5f5283a4accd6fd6f3f4a289353d2b82e8a6fca4145c1597b2df213b6e9ae/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f70657269646f742d7068702f6c656f2d687474702d666f756e646174696f6e2f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/peridot-php/leo-http-foundation/?branch=master)

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

\##Usage

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

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

\##Assertions

\###-&gt;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']);
expect($response)->to->not->allow(['GET']);
```

\###-&gt;status(status, \[message\])

- @param `int` $status
- @param `string` $message \[optional\]

Asserts that the response status is equal to `status`.

```
expect($response)->to->have->status(200);
expect($response)->to->not->have->status(400);
```

\###-&gt;json

- @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->to->have->property('name');
expect($response)->json->to->loosely->equal($expected);
expect($response)->json(true, 999, JSON_BIGINT_AS_STRING)->to->equal($expected);
```

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 81.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~50 days

Total

2

Last Release

4107d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f71e23eec19a24f64f37c622e76e725c9a580f83ff40c411da9bad97e0a49089?d=identicon)[brianium](/maintainers/brianium)

---

Top Contributors

[![brianium](https://avatars.githubusercontent.com/u/636651?v=4)](https://github.com/brianium "brianium (13 commits)")[![austinsmorris](https://avatars.githubusercontent.com/u/1616868?v=4)](https://github.com/austinsmorris "austinsmorris (3 commits)")

### Embed Badge

![Health badge](/badges/peridot-php-leo-http-foundation/health.svg)

```
[![Health](https://phpackages.com/badges/peridot-php-leo-http-foundation/health.svg)](https://phpackages.com/packages/peridot-php-leo-http-foundation)
```

###  Alternatives

[symfony/security-bundle

Provides a tight integration of the Security component into the Symfony full-stack framework

2.5k172.9M1.8k](/packages/symfony-security-bundle)[statamic/cms

The Statamic CMS Core Package

4.8k3.2M720](/packages/statamic-cms)[laravel/reverb

Laravel Reverb provides a real-time WebSocket communication backend for Laravel applications.

1.5k9.4M48](/packages/laravel-reverb)[elgg/elgg

Elgg is an award-winning social networking engine, delivering the building blocks that enable businesses, schools, universities and associations to create their own fully-featured social networks and applications.

1.7k15.7k4](/packages/elgg-elgg)[api-platform/http-cache

API Platform HttpCache component

223.2M7](/packages/api-platform-http-cache)[mapado/rest-client-sdk

Rest Client SDK for hydra API

1125.9k2](/packages/mapado-rest-client-sdk)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
