PHPackages                             s3cc0/restful-api-test-engine - 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. s3cc0/restful-api-test-engine

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

s3cc0/restful-api-test-engine
=============================

This is a simple API Test-Engine. With simple JSON files you can run tests for all your RESTful API's.

v1.0-stable(10y ago)6121MITPHPPHP &gt;=5.5

Since Dec 11Pushed 10y ago3 watchersCompare

[ Source](https://github.com/s3cc0/php-api-test-engine)[ Packagist](https://packagist.org/packages/s3cc0/restful-api-test-engine)[ RSS](/packages/s3cc0-restful-api-test-engine/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Introduction
============

[](#introduction)

This bundle provides a class for a simple API Test. The tests run on the terminal using `run.php`.

[![PHP API test engine screenshot](/../screenshots/php_api_test_engine_preview.png?raw=true)](/../screenshots/php_api_test_engine_preview.png?raw=true)

How to use?
-----------

[](#how-to-use)

In the folder you will find `run.php`. Run this file with given params to setup the test engine.

If you have written some tests. Then you can execute them with:

```
$ php run.php -u  -t   -m  -n  -c
```

*Example:*

```
php run.php -u "http://httpbin.org" -t "jsons/"  -m "mocks/" -n 10 -c 2
```

How to write tests?
-------------------

[](#how-to-write-tests)

First of all, all tests must contain in the same folder, sub folder are ignored.

\###Create a simple test###

A test can contain one or more subtests.

```
{
	"tests" : [
		{
			"name" : "Try to login with a wrong data",
			"path" : "/login",
			"method" : "POST",
			"request_params" : {
				"email" : "empty@me.com",
				"password" : "12345678"
			},
			"validation" : {
				"http_code" : 406,
				"response_params" : {
					"code" : 406,
					"message" : "$nn"
				}
			}
		},
		...
	]
}
```

**Options**

- $nn - means should be "not null"
- $eq - means check variable 1 of a response is equal to variable 2
- .$c - will return the count of the keypath (used for arrays)
- $ia - means check variable is an array
- *more options in the next version ...*

\###Save variables###

To reuse output or created data you can save them to the globals (note: use unique keys!). Keypath should be a available path inside the request response.

```
"save_global" : [
	{ "key" : "account_id", "keypath" : "account.id" }
]
```

To reuse the save variable you can do it easy with `{$account_id}`

```
"name" : "Delete account with id {$account_id}",
"path" : "/accounts/{$account_id}",
```

\###Using mocks###

If you have create mocks, you can easy load them by adding a string to the `request_params`. This example will load the mock `account.json`.

```
"request_params" : "account",
```

You can also use mocks to validate the response values. For this add `mock` inside the validation.

```
"validation" : {
	"http_code" : 200,
	"mock" : "account"
},
```

\###Extended Header###

You can extend and overwrite the reuqest header using the `header` in the test set. The header variables will also listing to the global saved variables.

```
"header" : {
    "Authorization" : "Bearer {$access_token}"
}
```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 91.3% 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

3811d ago

### Community

Maintainers

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

---

Top Contributors

[![s3cc0](https://avatars.githubusercontent.com/u/474134?v=4)](https://github.com/s3cc0 "s3cc0 (21 commits)")[![moehlone](https://avatars.githubusercontent.com/u/5398340?v=4)](https://github.com/moehlone "moehlone (2 commits)")

---

Tags

apitestrestful

### Embed Badge

![Health badge](/badges/s3cc0-restful-api-test-engine/health.svg)

```
[![Health](https://phpackages.com/badges/s3cc0-restful-api-test-engine/health.svg)](https://phpackages.com/packages/s3cc0-restful-api-test-engine)
```

###  Alternatives

[ubirak/rest-api-behat-extension

Rest Api Extension for Behat

41327.0k2](/packages/ubirak-rest-api-behat-extension)[kielabokkie/jsonapi-behat-extension

Behat extension for testing JSON APIs

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

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

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

PHPackages © 2026

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