PHPackages                             friends-of-phpspec/phpspec-requires - 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. friends-of-phpspec/phpspec-requires

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

friends-of-phpspec/phpspec-requires
===================================

PHPSpec extension that allows you to use the @requires annotation.

1.1.4(6y ago)1465[1 issues](https://github.com/friends-of-phpspec/phpspec-requires/issues)2MITPHPPHP &gt;= 7.1

Since Dec 28Pushed 6y agoCompare

[ Source](https://github.com/friends-of-phpspec/phpspec-requires)[ Packagist](https://packagist.org/packages/friends-of-phpspec/phpspec-requires)[ RSS](/packages/friends-of-phpspec-phpspec-requires/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (6)Versions (2)Used By (2)

[![Latest Stable Version](https://camo.githubusercontent.com/8f802e26b517ec0d6a319225db147c6fb400071c8ef9787b6678d0b5b212e7c7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f667269656e64732d6f662d706870737065632f706870737065632d72657175697265732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/friends-of-phpspec/phpspec-requires)[![GitHub stars](https://camo.githubusercontent.com/481f434459610902b75b3098ed62cf70c2cabd3ee776e7a08c6b099ad1024a07/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f667269656e64732d6f662d706870737065632f706870737065632d72657175697265732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/friends-of-phpspec/phpspec-requires)[![Total Downloads](https://camo.githubusercontent.com/b69b8dba14236eb938313409d120358c4677f78445a20d6dfae1964fda9fbf58/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f667269656e64732d6f662d706870737065632f706870737065632d72657175697265732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/friends-of-phpspec/phpspec-requires)[![GitHub Workflow Status](https://camo.githubusercontent.com/285c584b0a8228fc9eeedc89342b80c5958577351765fd6166e6da936809d812/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f667269656e64732d6f662d706870737065632f706870737065632d72657175697265732f436f6e74696e756f7573253230496e746567726174696f6e3f7374796c653d666c61742d737175617265)](https://github.com/friends-of-phpspec/phpspec-requires/actions)[![License](https://camo.githubusercontent.com/cb0e0211224cbc726ddda2237da2eecf649b8e255823bda163fa9f34ea5f1488/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f667269656e64732d6f662d706870737065632f706870737065632d72657175697265732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/friends-of-phpspec/phpspec-requires)

PHPSpec requires extension
==========================

[](#phpspec-requires-extension)

A [PHPSpec](http://www.phpspec.net) extension that allows you to use the annotation `@requires`.

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

[](#installation)

```
composer require friends-of-phpspec/phpspec-requires --dev
```

Usage
-----

[](#usage)

Enable extension in `phpspec.yml` (or `phpspec.yml.dist`) file:

```
extensions:
  FriendsOfPhpspec\PhpspecRequires\PhpspecRequires: ~
```

Then, you can use the annotation `@requires` in the documentation block of your spec methods.

```
/**
 * @requires OS Windows
 */
public function it_will_be_tested_on_windows_operating_system_only() {
  // test code here
}

/**
 * @requires OSFAMILY bsd
 */
public function it_will_be_tested_on_bsd_operating_system_family() {
  // test code here
}

/**
 * @requires function customFunction
 */
public function it_will_be_tested_only_if_the_function_is_found() {
  // test code here
}

/**
 * @requires extension mysqli
 */
public function it_will_be_tested_only_if_extension_is_found() {
  // test code here
}

/**
 * @requires PHP 7.3
 */
public function it_will_be_tested_only_if_php_version_is_equal_or_greater() {
  // test code here
}
```

Todo
====

[](#todo)

- Tests

Contributing
------------

[](#contributing)

See the file [CONTRIBUTING.md](.github/CONTRIBUTING.md) but feel free to contribute to this library by sending Github pull requests.

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity52

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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

2327d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3a5b33672e6fed2f03fee680279b6bddb884ca494237764e8c4dbb2c77e8bf05?d=identicon)[drupol](/maintainers/drupol)

---

Top Contributors

[![drupol](https://avatars.githubusercontent.com/u/252042?v=4)](https://github.com/drupol "drupol (15 commits)")

### Embed Badge

![Health badge](/badges/friends-of-phpspec-phpspec-requires/health.svg)

```
[![Health](https://phpackages.com/badges/friends-of-phpspec-phpspec-requires/health.svg)](https://phpackages.com/packages/friends-of-phpspec-phpspec-requires)
```

###  Alternatives

[benconstable/phpspec-laravel

Test your Laravel applications with PhpSpec

144347.1k15](/packages/benconstable-phpspec-laravel)[akeneo/phpspec-skip-example-extension

Skip your PhpSpec examples through annotations

34978.5k11](/packages/akeneo-phpspec-skip-example-extension)[friends-of-phpspec/phpspec-code-coverage

Generate Code Coverage reports for PhpSpec tests

202.6M125](/packages/friends-of-phpspec-phpspec-code-coverage)[rmiller/behat-spec

Behat and PhpSpec integration

5321.7k8](/packages/rmiller-behat-spec)[proget-hq/phpstan-phpspec

PhpSpec extension for PHPStan

2030.2k](/packages/proget-hq-phpstan-phpspec)

PHPackages © 2026

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