PHPackages                             danrspencer/phpunit-expect-syntax - 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. danrspencer/phpunit-expect-syntax

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

danrspencer/phpunit-expect-syntax
=================================

Expect syntax for PHPUnit assertions

2.0.0(7y ago)17.2k3MITPHPPHP &gt;=7.0

Since Nov 17Pushed 7y ago2 watchersCompare

[ Source](https://github.com/danrspencer/phpunit-expect-syntax)[ Packagist](https://packagist.org/packages/danrspencer/phpunit-expect-syntax)[ Docs](https://github.com/danrspencer/phpunit-expect-syntax)[ RSS](/packages/danrspencer-phpunit-expect-syntax/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (3)Used By (0)

phpunit-expect-syntax
=====================

[](#phpunit-expect-syntax)

A wrapper for PHPUnit which allows expect assertion syntax inspired by JavaScript's Jasmine.

**Note: currently incomplete - if I'm missing a matcher you need create an issue or pull request**

Installation
------------

[](#installation)

### Step 1. Install via Composer

[](#step-1-install-via-composer)

The preferred way to install this bundle is via Composer. Just add it to your composer.json:

```
{
    "require": {
        // ...
        "danrspencer/phpunit-expect-syntax": "2.0.0"
    }
}
```

### Step 2. Include the expect-syntax.php file

[](#step-2-include-the-expect-syntaxphp-file)

To begin using the syntax you'll need to include the expect-syntax.php file. This can be done in your PHPUnit bootstrap (recommended) or in invididual tests.

e.g.

```
require_once '../vendor/danrspencer/phpunit-expect-syntax/ExpectSyntax.php';
```

Example usage
-------------

[](#example-usage)

```
/** @test */
function it_tests_something() {
	expect($this)->toEqual($that);
}
```

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 97.2% 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 ~924 days

Total

2

Last Release

2911d ago

Major Versions

1.0.0 → 2.0.02018-05-29

PHP version history (2 changes)1.0.0PHP &gt;=5.3.0

2.0.0PHP &gt;=7.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/4245616?v=4)[Dan Spencer](/maintainers/danrspencer)[@danrspencer](https://github.com/danrspencer)

---

Top Contributors

[![danrspencer](https://avatars.githubusercontent.com/u/4245616?v=4)](https://github.com/danrspencer "danrspencer (35 commits)")[![jsnsimpson](https://avatars.githubusercontent.com/u/3789456?v=4)](https://github.com/jsnsimpson "jsnsimpson (1 commits)")

---

Tags

testingphpunitexpect

### Embed Badge

![Health badge](/badges/danrspencer-phpunit-expect-syntax/health.svg)

```
[![Health](https://phpackages.com/badges/danrspencer-phpunit-expect-syntax/health.svg)](https://phpackages.com/packages/danrspencer-phpunit-expect-syntax)
```

###  Alternatives

[brianium/paratest

Parallel testing for PHP

2.5k118.8M754](/packages/brianium-paratest)[spatie/phpunit-snapshot-assertions

Snapshot testing with PHPUnit

69617.9M510](/packages/spatie-phpunit-snapshot-assertions)[phpunit/phpunit-selenium

Selenium Server integration for PHPUnit

59610.9M150](/packages/phpunit-phpunit-selenium)[yoast/phpunit-polyfills

Set of polyfills for changed PHPUnit functionality to allow for creating PHPUnit cross-version compatible tests

18438.5M841](/packages/yoast-phpunit-polyfills)[ta-tikoma/phpunit-architecture-test

Methods for testing application architecture

10745.9M13](/packages/ta-tikoma-phpunit-architecture-test)[matthiasnoback/symfony-config-test

Library for testing user classes related to the Symfony Config Component

1679.8M395](/packages/matthiasnoback-symfony-config-test)

PHPackages © 2026

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