PHPackages                             aedon/php-expectations - 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. aedon/php-expectations

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

aedon/php-expectations
======================

1.1.0(11mo ago)06041MITPHPPHP &gt;=8.3

Since Jan 15Pushed 11mo ago1 watchersCompare

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

READMEChangelog (10)Dependencies (3)Versions (13)Used By (1)

Aedon PHP Expectations
======================

[](#aedon-php-expectations)

[![GitHub release](https://camo.githubusercontent.com/df40378c418f1381076bc2de1c8ab93587c4a3f57a02762d4bef8609813c2fd6/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f52797365536c6164652f7068702d6578706563746174696f6e732e737667)](https://github.com/RyseSlade/php-expectations/releases/)[![GitHub license](https://camo.githubusercontent.com/f8df3091bbe1149f398a5369b2c39e896766f9f6efba3477c63e9b4aa940ef14/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d677265656e)](https://github.com/RyseSlade/php-expectations/blob/master/LICENSE)

Reduce lines of code with this expectations library. Use expectations for conditional exceptions.

### Requirements

[](#requirements)

PHP 8.3+

### Usage examples

[](#usage-examples)

#### Basic example

[](#basic-example)

Instead of...

```
$value = new stdClass();

if (!$value instanceof stdClass) {
    throw new InvalidArgumentException('some message');
}
```

Do it like this...

```
$value = new stdClass();

\Aedon\Expect::isInstanceOf($value, stdClass::class);
```

#### Custom Exceptions

[](#custom-exceptions)

In case you want to change the exception thrown for specific tests.

```
\Aedon\Expect::registerCustomException('isTrue', InvalidArgumentException::class);

// This will now throw InvalidArgumentException instead of RuntimeException
\Aedon\Expect::isTrue(false);
```

This can also be used to execute a callable when an expectation fails.

```
\Aedon\Expect::registerCustomException('isTrue', function() {
    return false; // omit this if you still want to throw the default exception
});
```

### Support

[](#support)

Join Discord:

Aedon PHP Expectations created by Michael "Striker" Berger

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance50

Moderate activity, may be stable

Popularity13

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity79

Established project with proven stability

 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.

###  Release Activity

Cadence

Every ~178 days

Recently: every ~356 days

Total

12

Last Release

350d ago

Major Versions

0.9.10 → 1.0.02023-03-12

PHP version history (5 changes)0.9.2PHP &gt;=7.4

0.9.3PHP &gt;=7.3

0.9.6PHP &gt;=7.4|&gt;=8.0

1.0.0PHP ^8.0

1.1.0PHP &gt;=8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/1beed4a47e4a879a0dea43c55e70e899f6670234ff2fce51f34c17ba8bee02de?d=identicon)[aedon](/maintainers/aedon)

---

Top Contributors

[![RyseSlade](https://avatars.githubusercontent.com/u/4416687?v=4)](https://github.com/RyseSlade "RyseSlade (23 commits)")

---

Tags

php

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Type Coverage Yes

### Embed Badge

![Health badge](/badges/aedon-php-expectations/health.svg)

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

###  Alternatives

[phpspec/prophecy

Highly opinionated mocking framework for PHP 5.3+

8.5k551.7M682](/packages/phpspec-prophecy)[vimeo/psalm

A static analysis tool for finding errors in PHP applications

5.8k77.5M6.7k](/packages/vimeo-psalm)[brianium/paratest

Parallel testing for PHP

2.5k118.8M754](/packages/brianium-paratest)[beberlei/assert

Thin assertion library for input validation in business models.

2.4k96.9M570](/packages/beberlei-assert)[mikey179/vfsstream

Virtual file system to mock the real file system in unit tests.

1.4k108.0M2.7k](/packages/mikey179-vfsstream)[orchestra/testbench

Laravel Testing Helper for Packages Development

2.2k39.1M32.1k](/packages/orchestra-testbench)

PHPackages © 2026

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