PHPackages                             expectation/expectation - 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. [Testing &amp; Quality](/categories/testing)
4. /
5. expectation/expectation

ActiveLibrary[Testing &amp; Quality](/categories/testing)

expectation/expectation
=======================

expectation library for unit testing

1.4.4(11y ago)44.2k[4 issues](https://github.com/expectation-php/expectation/issues)MITPHPPHP &gt;=5.4.0

Since Jun 29Pushed 11y ago1 watchersCompare

[ Source](https://github.com/expectation-php/expectation)[ Packagist](https://packagist.org/packages/expectation/expectation)[ RSS](/packages/expectation-expectation/feed)WikiDiscussions master Synced 4d ago

READMEChangelog (1)Dependencies (13)Versions (25)Used By (0)

Expectation
===========

[](#expectation)

**Expectation** is the assertion library for unit testing.
This library inspired by [pho](https://github.com/danielstjules/pho) of bdd test framework.

[![Latest Stable Version](https://camo.githubusercontent.com/ce15b660ace4eb3819e63b4350971bade8549bdf211f0735f933c5059cfab355/68747470733a2f2f706f7365722e707567782e6f72672f6578706563746174696f6e2f6578706563746174696f6e2f762f737461626c652e737667)](https://packagist.org/packages/expectation/expectation)[![Latest Unstable Version](https://camo.githubusercontent.com/5044ae98664b0f965923ec2749ec92387be1d5a497d7782ce094b4120f115b42/68747470733a2f2f706f7365722e707567782e6f72672f6578706563746174696f6e2f6578706563746174696f6e2f762f756e737461626c652e737667)](https://packagist.org/packages/expectation/expectation)[![Dependency Status](https://camo.githubusercontent.com/03bf64ce85d7d4f47d94a3534ca1278cce940bd7af4ff695516da2fbac5ccfd2/68747470733a2f2f7777772e76657273696f6e6579652e636f6d2f757365722f70726f6a656374732f3534353033326466396663346435336336353030303239342f62616467652e7376673f7374796c653d666c6174)](https://www.versioneye.com/user/projects/545032df9fc4d53c65000294)

[![Build Status](https://camo.githubusercontent.com/7dda874ff1f763460fb2a8b6f251a511aaa86a100424dead57e310cc00473e3b/68747470733a2f2f7472617669732d63692e6f72672f6578706563746174696f6e2d7068702f6578706563746174696f6e2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/expectation-php/expectation)[![HHVM Status](https://camo.githubusercontent.com/2bab4f487e970a042b60ac5d363233e4d6091a46f034c8000a9b59a451bc3bcc/687474703a2f2f6868766d2e683463632e64652f62616467652f6578706563746174696f6e2f6578706563746174696f6e2e737667)](http://hhvm.h4cc.de/package/expectation/expectation)[![Coverage Status](https://camo.githubusercontent.com/23572aa19d1b4d41e827175e92fcae3382de0b0aca3fa4847adabc38699929d6/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6578706563746174696f6e2d7068702f6578706563746174696f6e2f62616467652e706e673f6272616e63683d6d6173746572)](https://coveralls.io/r/expectation-php/expectation?branch=master)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/d6dd3c33e2c0a1ce78edad74bdaf434e13403c57bff6d1ce1698e5c89428f303/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6578706563746174696f6e2d7068702f6578706563746174696f6e2f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/expectation-php/expectation/?branch=master)[![Stories in Ready](https://camo.githubusercontent.com/77cfbae61e872333ffc9d6eeb142eaa1a6a90e04b389f80a0c8ede65be246f09/68747470733a2f2f62616467652e776166666c652e696f2f6578706563746174696f6e2d7068702f6578706563746174696f6e2e7376673f6c6162656c3d7265616479267469746c653d5265616479)](http://waffle.io/expectation-php/expectation)

This package is not longer being maintained.
Please use the [expect](https://github.com/expectation-php/expect) instead.

- [Installation](https://github.com/expectation-php/expectation/wiki/Installation)
- [Basic usage](https://github.com/expectation-php/expectation/wiki/Basic-usage)
- [Basic matchers](https://github.com/expectation-php/expectation/wiki/Basic-matchers)
- [Custom-matchers](https://github.com/expectation-php/expectation/wiki/Custom-matchers)
- [Domain specific language](https://github.com/expectation-php/expectation/wiki/Domain-specific-language)

Run unit test
-------------

[](#run-unit-test)

```
composer test

```

Code metrics
------------

[](#code-metrics)

```
composer metrics

```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 99.8% 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 ~12 days

Total

22

Last Release

4068d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/70c299d6d6015ee714954aa05e4d0e9c7b1d31318a5d7db5e9bb4e1f70f78afc?d=identicon)[holyshared](/maintainers/holyshared)

---

Top Contributors

[![holyshared](https://avatars.githubusercontent.com/u/167190?v=4)](https://github.com/holyshared "holyshared (445 commits)")[![waffle-iron](https://avatars.githubusercontent.com/u/6912981?v=4)](https://github.com/waffle-iron "waffle-iron (1 commits)")

---

Tags

testBDDassertspecexpect

### Embed Badge

![Health badge](/badges/expectation-expectation/health.svg)

```
[![Health](https://phpackages.com/badges/expectation-expectation/health.svg)](https://phpackages.com/packages/expectation-expectation)
```

###  Alternatives

[mockery/mockery

Mockery is a simple yet flexible PHP mock object framework

10.7k497.0M23.6k](/packages/mockery-mockery)[phpspec/phpspec

Specification-oriented BDD framework for PHP 7.1+

1.9k36.7M3.1k](/packages/phpspec-phpspec)[php-mock/php-mock

PHP-Mock can mock built-in PHP functions (e.g. time()). PHP-Mock relies on PHP's namespace fallback policy. No further extension is needed.

36918.1M98](/packages/php-mock-php-mock)[php-mock/php-mock-phpunit

Mock built-in PHP functions (e.g. time()) with PHPUnit. This package relies on PHP's namespace fallback policy. No further extension is needed.

1718.2M399](/packages/php-mock-php-mock-phpunit)[polishsymfonycommunity/symfony-mocker-container

Provides base Symfony dependency injection container enabling service mocking.

1468.0M237](/packages/polishsymfonycommunity-symfony-mocker-container)[dvdoug/behat-code-coverage

Generate Code Coverage reports for Behat tests

593.6M37](/packages/dvdoug-behat-code-coverage)

PHPackages © 2026

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