PHPackages                             mehr-als-nix/assumptions - 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. mehr-als-nix/assumptions

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

mehr-als-nix/assumptions
========================

Assumptions can be used to skip tests when common preconditions, like the PHP Version or installed extensions, are not met.

v4.0.0(8y ago)38.9k21MITPHPPHP &gt;=7.1

Since May 17Pushed 8y ago2 watchersCompare

[ Source](https://github.com/MehrAlsNix/Assumptions)[ Packagist](https://packagist.org/packages/mehr-als-nix/assumptions)[ Docs](http://mehralsnix.github.io/Assumptions)[ RSS](/packages/mehr-als-nix-assumptions/feed)WikiDiscussions develop Synced today

READMEChangelog (7)Dependencies (4)Versions (9)Used By (1)

Assumptions (not only) for PHPUnit.
===================================

[](#assumptions-not-only-for-phpunit)

[![Build Status](https://camo.githubusercontent.com/3349b763ce74c2ce7938d6f238fba70f3e29a55507839f119298690b5e5a502e/68747470733a2f2f7472617669732d63692e6f72672f4d656872416c734e69782f417373756d7074696f6e732e7376673f6272616e63683d646576656c6f70)](https://travis-ci.org/MehrAlsNix/Assumptions) [![Code Climate](https://camo.githubusercontent.com/9c1ba23901e031b1f9b79c582152ac20ec4dbc87ead2548c42e809cc211c7b7e/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f4d656872416c734e69782f417373756d7074696f6e732f6261646765732f6770612e737667)](https://codeclimate.com/github/MehrAlsNix/Assumptions) [![Test Coverage](https://camo.githubusercontent.com/51f9237739a88bab2c793d38e7d2efcb2abd16df58bf42a109ab6f90b5535792/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f4d656872416c734e69782f417373756d7074696f6e732f6261646765732f636f7665726167652e737667)](https://codeclimate.com/github/MehrAlsNix/Assumptions/coverage) [![Dependency Status](https://camo.githubusercontent.com/16774b81507b3ff02dd12ab0b35d3917a85d8d7b1d16de3971e1e161b975d45f/68747470733a2f2f7777772e76657273696f6e6579652e636f6d2f757365722f70726f6a656374732f3535353861613665623266663664326563633030303336382f62616467652e7376673f7374796c653d666c6174)](https://www.versioneye.com/user/projects/5558aa6eb2ff6d2ecc000368)[![Latest Stable Version](https://camo.githubusercontent.com/b044a8843b6a8aac6363c5622875a56d7a98c51647f04a85f32420912b651a75/68747470733a2f2f706f7365722e707567782e6f72672f6d6568722d616c732d6e69782f617373756d7074696f6e732f762f737461626c65)](https://packagist.org/packages/mehr-als-nix/assumptions) [![Latest Unstable Version](https://camo.githubusercontent.com/ea35d9c6db74ef44d8ab8be137182f924db20896f1415beeb1e6d7c3880e6fc7/68747470733a2f2f706f7365722e707567782e6f72672f6d6568722d616c732d6e69782f617373756d7074696f6e732f762f756e737461626c65)](https://packagist.org/packages/mehr-als-nix/assumptions) [![License](https://camo.githubusercontent.com/0d0ca03c5aff5da47d2e4d8de6eac24fd843b977307befcaf4f56f68ba2c82b6/68747470733a2f2f706f7365722e707567782e6f72672f6d6568722d616c732d6e69782f617373756d7074696f6e732f6c6963656e7365)](https://packagist.org/packages/mehr-als-nix/assumptions) [![Total Downloads](https://camo.githubusercontent.com/c04ba77dcbc4d77c5fe21103aa56f08b4c34e463b759339f08c4b2d5b49a8605/68747470733a2f2f706f7365722e707567782e6f72672f6d6568722d616c732d6e69782f617373756d7074696f6e732f646f776e6c6f616473)](https://packagist.org/packages/mehr-als-nix/assumptions)[![Build status](https://camo.githubusercontent.com/212646c9b0bbbe5d2b6d01cc957693722430b3c056bdaa635e653bc1267e26bb/68747470733a2f2f63692e6170707665796f722e636f6d2f6170692f70726f6a656374732f7374617475732f78716364726c38623632643671726c652f6272616e63682f646576656c6f703f7376673d74727565)](https://ci.appveyor.com/project/siad007/assumptions/branch/develop)

Introduction
------------

[](#introduction)

Assumptions can be used to skip tests when common preconditions, like the PHP Version or installed extensions, are not met.

The default PHPUnit runner treats tests with failing assumptions as skipped. Custom runners may behave differently.

We have included several assumptions like `assumeTrue`, `assumeExtensionLoaded`,... by default. All of those functions are subsumed in assumeThat, with the appropriate `Hamcrest` matcher.

A failing assumption in a `@before` or `@beforeClass` method will have the same effect as a failing assumption in each `@test` method of the class.

---

The concept behind **Assumptions for PHPUnit** is based on the adequate junit feature, which is documented on their [wiki - Assumptions with assume](https://github.com/junit-team/junit/wiki/Assumptions-with-assume)

Note
----

[](#note)

There is a similar feature in PHPUnit called [@requires](https://phpunit.de/manual/current/en/appendixes.annotations.html#appendixes.annotations.requires)!

If you are familiar in using `@requires` annotation to dedicate that a given [requirement](https://phpunit.de/manual/current/en/incomplete-and-skipped-tests.html#incomplete-and-skipped-tests.requires.tables.api) would be given and you are happy about, then you just do not need the use of **Assumption for PHPUnit**.

But if you want to have

- code completion
- better readability
- finer control
- more requirement abilities

then you should give **Assumption for PHPUnit** a try.

---

Requirements
------------

[](#requirements)

- PHP &gt;= 7.1

if you are looking for a version which supports PHP &lt; 7.0.7 just use the v2.0.0

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

[](#installation)

[see wiki:installation](https://github.com/MehrAlsNix/Assumptions/wiki/1.-Installation)

Assumptions
-----------

[](#assumptions)

[see wiki:assumptions](https://github.com/MehrAlsNix/Assumptions/wiki/2.-Assumptions)

Examples
--------

[](#examples)

[see wiki:examples](https://github.com/MehrAlsNix/Assumptions/wiki/3.-Examples)

ResultPrinter
-------------

[](#resultprinter)

[see wiki:result-printer](https://github.com/MehrAlsNix/Assumptions/wiki/4.-ResultPrinter)

###  Health Score

33

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity63

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 ~167 days

Recently: every ~249 days

Total

7

Last Release

3063d ago

Major Versions

v1.1.0 → v2.0.02015-10-10

v2.0.0 → v3.0.02017-06-05

v3.0.0 → v4.0.02018-02-12

PHP version history (4 changes)v1.0.0PHP &gt;=5.6

v1.1.0PHP &gt;=5.4

v3.0.0PHP &gt;=7.0.7

v4.0.0PHP &gt;=7.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/197f7436c47067343def1d182dd597dbd104774fe17071e0b983487dc3652fe8?d=identicon)[siad007](/maintainers/siad007)

---

Top Contributors

[![siad007](https://avatars.githubusercontent.com/u/2149445?v=4)](https://github.com/siad007 "siad007 (105 commits)")

---

Tags

phpunittestingtestingphpunit

### Embed Badge

![Health badge](/badges/mehr-als-nix-assumptions/health.svg)

```
[![Health](https://phpackages.com/badges/mehr-als-nix-assumptions/health.svg)](https://phpackages.com/packages/mehr-als-nix-assumptions)
```

###  Alternatives

[brianium/paratest

Parallel testing for PHP

2.5k136.1M986](/packages/brianium-paratest)[orchestra/testbench

Laravel Testing Helper for Packages Development

2.2k42.5M40.8k](/packages/orchestra-testbench)[spatie/phpunit-snapshot-assertions

Snapshot testing with PHPUnit

69619.8M640](/packages/spatie-phpunit-snapshot-assertions)[yoast/phpunit-polyfills

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

18543.6M1.3k](/packages/yoast-phpunit-polyfills)[ta-tikoma/phpunit-architecture-test

Methods for testing application architecture

10958.3M21](/packages/ta-tikoma-phpunit-architecture-test)[allure-framework/allure-phpunit

Allure PHPUnit integration

6913.4M46](/packages/allure-framework-allure-phpunit)

PHPackages © 2026

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