PHPackages                             atoum/apiblueprint-extension - 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. atoum/apiblueprint-extension

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

atoum/apiblueprint-extension
============================

Compile and run tests written in the API Blueprint format (`.apib`) with atoum

0.2.1(8y ago)181MITPHPPHP &gt;7.0

Since Nov 29Pushed 8y ago1 watchersCompare

[ Source](https://github.com/Hywan/atoum-apiblueprint-extension)[ Packagist](https://packagist.org/packages/atoum/apiblueprint-extension)[ Docs](http://www.atoum.org)[ RSS](/packages/atoum-apiblueprint-extension/feed)WikiDiscussions master Synced yesterday

READMEChangelog (3)Dependencies (6)Versions (5)Used By (0)

 [![atoum's extension logo](./res/logo.png)](./res/logo.png)

atoum/apiblueprint-extension [![Build Status](https://camo.githubusercontent.com/7458701a14ae23ed8cb6f6addeaa7712c8f6f92dc7ce8f4a798b725aeed7c507/68747470733a2f2f7472617669732d63692e6f72672f487977616e2f61746f756d2d617069626c75657072696e742d657874656e73696f6e2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/Hywan/atoum-apiblueprint-extension)
==================================================================================================================================================================================================================================================================================================================================================================

[](#atoumapiblueprint-extension-)

**The candidates**:

1. [atoum](http://atoum.org/) is a PHP test framework,
2. [API Blueprint](https://apiblueprint.org/) is a high-level HTTP API description language.

**The problem**: API Blueprint is only a text file. Easy to read for human, but a machine can't do anything with it.

**The solution**: Compile API Blueprint files into executable tests. It works as any test written with the atoum API, and it works within the atoum ecosystem. Here is an overview of the workflow:

 [![Process overview](./res/overview.svg)](./res/overview.svg)

In more details, here is what happens:

1. A finder iterates over `.apib` files,
2. For each file, it is parsed into an intermediate representation,
3. The intermediate representation is compiled to target “atoum tests”,
4. The fresh tests are pushed in the test queue of atoum,
5. atoum executes everything as usual.

**The bonus**: A very simple script is provided to *render* many API Blueprint files as a standalone HTML single-page file.

Installation and configuration
------------------------------

[](#installation-and-configuration)

With [Composer](https://getcomposer.org/), to include this extension into your dependencies, you need to require [`atoum/apiblueprint-extension`](https://packagist.org/packages/atoum/apiblueprint-extension):

```
$ composer require atoum/apiblueprint-extension '~0.2'
```

To enable the extension, the `.atoum.php` configuration file must be edited to add:

```
$extension = new atoum\apiblueprint\extension($script);
$extension->addToRunner($runner);
```

### Configure the finder

[](#configure-the-finder)

Assuming the `.apib` files are located in the `./apiblueprints`directory, the following code adds this directory to the API Blueprint finder, compiles everything to tests, and enqueue them:

```
$extension->getAPIBFinder()->append(new FilesystemIterator('./apiblueprints'));
$extension->compileAndEnqueue();
```

### Configure the location of JSON schemas when defined outside `.apib` files

[](#configure-the-location-of-json-schemas-when-defined-outside-apib-files)

API Blueprint uses [JSON Schema](http://json-schema.org/)to [validate HTTP requests and responses](https://apiblueprint.org/documentation/advanced-tutorial.html#json-schema) when the message aims at being a valid JSON message.

We recommend to define JSON schemas outside the `.apib` files for several reasons:

- They can be versionned independently from the `.apib` files,
- They can be used inside your application to validate incoming HTTP requests or outgoing HTTP responses,
- They can be used by other tools.

To do so, one must go through these 2 steps:

1. Mount a JSON schema directory with the help of the extension's configuration,
2. Use `{"$ref": "json-schema:///schema.json"}` in the [Schema section](https://apiblueprint.org/documentation/advanced-tutorial.html#json-schema).

Example:

1. In the `.atoum.php` file where the extension is configured:

    ```
    $extension->getConfiguration()->mountJsonSchemaDirectory('test', '/path/to/schemas/');
    ```
2. In the API Blueprint file:

    ```
    + Response 200

      + Schema

        {"$ref": "json-schema://test/api-foo/my-schema.json"}
    ```

    where `test` is the “mount point name”, and `/api-foo/my-schema.json` is a valid JSON schema file located at `/path/to/schemas/api-foo/my-schema.json`.

Testing
-------

[](#testing)

Before running the test suites, the development dependencies must be installed:

```
$ composer install
```

Then, to run all the test suites:

```
$ composer test
```

Compliance with the API Blueprint specification
-----------------------------------------------

[](#compliance-with-the-api-blueprint-specification)

This atoum extension implements the [API Blueprint specification](https://apiblueprint.org/documentation/specification.html).

Language featuresImplemented?Metadata sectionyesAPI name &amp; overview sectionyesResource group sectionyesResource sectionyesResource model sectionno (ignored)Schema sectionyesAction sectionyesRequest sectionyesResponse sectionyesURI parameters sectionno (ignored)Attributes sectionno (ignored)Headers sectionyesBody sectionyesData Structures sectionno (ignored)Relation sectionno (ignored)[Any help is welcomed](https://github.com/Hywan/atoum-apiblueprint-extension/issues/new)!

License
=======

[](#license)

Please, see the `LICENSE` file. This project uses the same license than atoum.

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity51

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

Every ~5 days

Total

3

Last Release

3075d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a410060743cec0e0d8654661b726a7a25f5888f18059d4c942a8fd9a8128f0da?d=identicon)[Hoa](/maintainers/Hoa)

---

Top Contributors

[![Hywan](https://avatars.githubusercontent.com/u/946104?v=4)](https://github.com/Hywan "Hywan (78 commits)")

---

Tags

apiapiblueprintatoumhttpjson-schemaphptest-frameworktestingtestatoumatoum-extensionapiblueprint

### Embed Badge

![Health badge](/badges/atoum-apiblueprint-extension/health.svg)

```
[![Health](https://phpackages.com/badges/atoum-apiblueprint-extension/health.svg)](https://phpackages.com/packages/atoum-apiblueprint-extension)
```

###  Alternatives

[atoum/atoum

Simple modern and intuitive unit testing framework for PHP 8.0+

1.4k2.6M311](/packages/atoum-atoum)[atoum/atoum-bundle

Bundle around atoum unit testing framework

44360.9k10](/packages/atoum-atoum-bundle)[ubirak/rest-api-behat-extension

Rest Api Extension for Behat

41327.0k2](/packages/ubirak-rest-api-behat-extension)[atoum/stubs

Stubs for atoum, the simple modern and intuitive unit testing framework for PHP 5.3+

17785.0k53](/packages/atoum-stubs)

PHPackages © 2026

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