PHPackages                             tecnickcom/tc-lib-testrest - 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. tecnickcom/tc-lib-testrest

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

tecnickcom/tc-lib-testrest
==========================

Library to test end-to-end RESTful services using Behat

2.10.10(6y ago)291MITPHPPHP &gt;=5.4CI failing

Since Nov 26Pushed 12mo ago1 watchersCompare

[ Source](https://github.com/tecnickcom/tc-lib-testrest)[ Packagist](https://packagist.org/packages/tecnickcom/tc-lib-testrest)[ Docs](https://github.com/tecnickcom/tc-lib-testrest)[ RSS](/packages/tecnickcom-tc-lib-testrest/feed)WikiDiscussions develop Synced 1mo ago

READMEChangelogDependencies (10)Versions (20)Used By (0)

tc-lib-testrest
===============

[](#tc-lib-testrest)

*PHP library to test end-to-end RESTful API services using Gherkin language (Behat)*

[![Latest Stable Version](https://camo.githubusercontent.com/0219278a22211ec63ad925ac366c5718682496d9d2f0e5eaa9875be71ff20134/68747470733a2f2f706f7365722e707567782e6f72672f7465636e69636b636f6d2f74632d6c69622d74657374726573742f76657273696f6e)](https://packagist.org/packages/tecnickcom/tc-lib-testrest)[![Master Build Status](https://camo.githubusercontent.com/a01cd7e685b071041df1732b557ef18e9b7c0addfdfd03548b21db1d0d611fb4/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f7465636e69636b636f6d2f74632d6c69622d74657374726573742e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/tecnickcom/tc-lib-testrest?branch=master)[![Master Coverage Status](https://camo.githubusercontent.com/0544036c9d91b1c8f9f60de70b14950bab72f86faa587e0ba029e42ce948c420/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f7465636e69636b636f6d2f74632d6c69622d74657374726573742f62616467652e7376673f6272616e63683d6d617374657226736572766963653d676974687562)](https://coveralls.io/github/tecnickcom/tc-lib-testrest?branch=master)[![License](https://camo.githubusercontent.com/04974e5973235fa609819c673bd52279f918db01ce5a8b5517b2b37800630083/68747470733a2f2f706f7365722e707567782e6f72672f7465636e69636b636f6d2f74632d6c69622d74657374726573742f6c6963656e7365)](https://packagist.org/packages/tecnickcom/tc-lib-testrest)[![Total Downloads](https://camo.githubusercontent.com/3e5a6f607617d1633f4bafb50e237a2f3214e8e88c3d72c8058745387101c4c5/68747470733a2f2f706f7365722e707567782e6f72672f7465636e69636b636f6d2f74632d6c69622d74657374726573742f646f776e6c6f616473)](https://packagist.org/packages/tecnickcom/tc-lib-testrest)

[![Develop Branch](https://camo.githubusercontent.com/d9ce2ea15f9952721cf4f489b01e7838d28c8ad5579bccfc44e1bffbac66506b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f2d646576656c6f703a2d677261792e737667)](https://github.com/tecnickcom/tc-lib-testrest/tree/develop)[![Develop Build Status](https://camo.githubusercontent.com/5c577f4ec9c95c89e6a8de086c5cfdf94fd93d80ede2e29bf705a56b5e7d3696/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f7465636e69636b636f6d2f74632d6c69622d74657374726573742e706e673f6272616e63683d646576656c6f70)](https://travis-ci.org/tecnickcom/tc-lib-testrest?branch=develop)[![Develop Coverage Status](https://camo.githubusercontent.com/738845fbeeef6cdc989a9d26c6a9cc8c482cd3dce1ff0d2b24f353968c260869/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f7465636e69636b636f6d2f74632d6c69622d74657374726573742f62616467652e7376673f6272616e63683d646576656c6f7026736572766963653d676974687562)](https://coveralls.io/github/tecnickcom/tc-lib-testrest?branch=develop)

[![Donate via PayPal](https://camo.githubusercontent.com/e5f561f4f549822da3fbfb75d0be9059a60eac15b1ff7af66500ca1dd4dba91b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f646f6e6174652d70617970616c2d3837636565622e737667)](https://www.paypal.com/donate/?hosted_button_id=NZUEC5XS8MFBJ)*Please consider supporting this project by making a donation via [PayPal](https://www.paypal.com/donate/?hosted_button_id=NZUEC5XS8MFBJ)*

- **category** Library
- **package** \\Com\\Tecnick\\TestRest
- **author** Nicola Asuni
- **copyright** 2015 MediaSift Ltd. , 2016-2017 Tecnick.com LTD
- **license** The MIT License (MIT) - see [LICENSE](LICENSE)
- **link**

Description
-----------

[](#description)

PHP library to test end-to-end RESTful API services using Gherkin language ([Behat](http://behat.org))

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

[](#installation)

This project requires PHP 5.4.0+ to use the PHP built-in web server.

- Create a composer.json in your projects root-directory and include this project:

```
{
    "require-dev": {
        "tecnickcom/tc-lib-testrest": "^2.10"
    }
}
```

Or add to an existing project with:

```
composer require tecnickcom/tc-lib-testrest ^2.10
```

- Create a behat.yml file in the root directory of your project like the one in test/behat.yml and check the internal comments and options.
- Create a test/features folder in your project like the one in test/features and write your own ".feature" files like the provided example.
- Create (or update) a makefile like the one in this project which contains the "btest" target. This target starts the PHP built-in server and execute the Behat tests.

Development - getting started
-----------------------------

[](#development---getting-started)

First, you need to install all dependencies (you'll need [composer](https://getcomposer.org/)):

```
$ cd /tmp && curl -sS https://getcomposer.org/installer | php
$ sudo mv composer.phar /usr/local/bin/composer
```

The following command will download all the composer dependencies required for development and testing:

```
make build_dev
```

### Running Tests

[](#running-tests)

The internal unit tests includes a database testing, so you need to install MySQL and SQLite with PDO drivers. You also need to create the following MySQL database with the right privileges:

```
CREATE DATABASE IF NOT EXISTS testrest_test;
GRANT ALL ON testrest_test.* TO 'testrest'@'%' IDENTIFIED BY 'testrest';
FLUSH PRIVILEGES;
```

You also need to install APC and memcached to test all features.

To execute all the tests you can now run `make qa_all`.

Please issue the command `make help` to see all available options and execute individual tests.

### Coding standards

[](#coding-standards)

This project follows the PSR2 coding standard. To see any errors in your code, you can use the `make phpcs` command. We also use a tool to detect any code smells. To run it, use `make phpmd`.

Before submitting a Pull Request, please execute the `make qa_all` to be sure that no errors where introduced. Additionally, please check the target/coverage/index.html report to be sure that every line of code is covered by a unit test. If you add any new gherkin language feature please also add an example in test/features.

Developer(s) Contact
--------------------

[](#developers-contact)

- Nicola Asuni

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance37

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity67

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

Recently: every ~263 days

Total

18

Last Release

2319d ago

### Community

Maintainers

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

---

Top Contributors

[![nicolaasuni](https://avatars.githubusercontent.com/u/1186996?v=4)](https://github.com/nicolaasuni "nicolaasuni (63 commits)")

---

Tags

testingapiBehatrestfulms-lib-testresttestrest

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/tecnickcom-tc-lib-testrest/health.svg)

```
[![Health](https://phpackages.com/badges/tecnickcom-tc-lib-testrest/health.svg)](https://phpackages.com/packages/tecnickcom-tc-lib-testrest)
```

###  Alternatives

[imbo/behat-api-extension

API extension for Behat

1082.5M9](/packages/imbo-behat-api-extension)[tonicforhealth/behat-parallel-scenario

Behat parallel scenario

24354.7k](/packages/tonicforhealth-behat-parallel-scenario)[jonathanjfshaw/phpunitbehat

Use Behat from within PHPUnit.

2143.8k1](/packages/jonathanjfshaw-phpunitbehat)[teaandcode/behat-guzzle-extension

Behat API extension using Guzzle Service Descriptions to functionally test API endpoints

1017.7k](/packages/teaandcode-behat-guzzle-extension)[kielabokkie/jsonapi-behat-extension

Behat extension for testing JSON APIs

1516.5k](/packages/kielabokkie-jsonapi-behat-extension)

PHPackages © 2026

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