PHPackages                             lvcodesmith/php-expect - 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. lvcodesmith/php-expect

AbandonedArchivedLibrary

lvcodesmith/php-expect
======================

14.0k↓50%PHP

Since Oct 29Pushed 10y agoCompare

[ Source](https://github.com/wscoble/php-expect)[ Packagist](https://packagist.org/packages/lvcodesmith/php-expect)[ RSS](/packages/lvcodesmith-php-expect/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Expect::your($test)-&gt;not-&gt;toSuck();
=========================================

[](#expectyourtest-not-tosuck)

[![Build Status](https://camo.githubusercontent.com/5e99411b3a3f7ad04141bf83457f4185e83ca712abb7079d116c34eb2e8f0dbb/68747470733a2f2f7472617669732d63692e6f72672f7773636f626c652f7068702d6578706563742e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/wscoble/php-expect)

I'm on Packigist!
-----------------

[](#im-on-packigist)

```
{
...
    "require": {
    ...
        "lvcodesmith/php-expect": "dev-master"
    ...
    }
...
}
```

Matching that doesn't suck ... mostly
-------------------------------------

[](#matching-that-doesnt-suck--mostly)

It is very easy to create a matcher using php-expect. Just put it in the Expect::$matchers static array. Here's how.

#### Matcher skeleton

[](#matcher-skeleton)

```
Expect::$matchers['matcher'] = function($actual, $expected) {
    return array(
        $positive_matcher = function() use ($actual, $expected) {

        }, "What to say when the positive matcher fails",

        $negative_matcher = function() use ($actual, $expected) {

        }, "What to say when the negative matcher fails"
    );
}
```

Of course, you don't need to write *$positive\_matcher =* or *$negative\_matcher =*, but it helps add context.

#### The *toSuck* matcher:

[](#the-tosuck-matcher)

```
Expect::$matchers['toSuck'] = function ($actual, $expected) {
    $class = get_class($actual);
    return array(
        $positive_matcher = function () use ($class) {
            assert( $class == 'Suck' );
        }, "Expected object to suck",

        $negative_matcher = function () use ($class) {
            assert( $class != 'Suck' );
        }, "Expected object not to suck"
    );
};
```

Social Updates
--------------

[](#social-updates)

This project will be using [Trello.com](https://trello.com) to manage the project. If you want access, please send a message to [@LVCSkunkworks](https://twitter.com/lvcskunkworks). Follow [@LVCSkunkworks](https://twitter.com/lvcskunkworks) to see real time activity.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/84b556b581821619a021507657234342aaf866c804b1ed374470a8cffca6f42f?d=identicon)[lvcodesmith](/maintainers/lvcodesmith)

---

Top Contributors

[![wscoble](https://avatars.githubusercontent.com/u/287393?v=4)](https://github.com/wscoble "wscoble (14 commits)")

### Embed Badge

![Health badge](/badges/lvcodesmith-php-expect/health.svg)

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

PHPackages © 2026

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