PHPackages                             rest-certain/rest-certain - 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. rest-certain/rest-certain

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

rest-certain/rest-certain
=========================

PHP DSL for easy testing of REST services, with a nod to the Java DSL, REST Assured

0.6.0(11mo ago)2942[5 PRs](https://github.com/rest-certain/rest-certain/pulls)LGPL-3.0-or-laterPHPPHP ~8.3.0 || ~8.4.0CI passing

Since May 6Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/rest-certain/rest-certain)[ Packagist](https://packagist.org/packages/rest-certain/rest-certain)[ RSS](/packages/rest-certain-rest-certain/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (6)Dependencies (35)Versions (10)Used By (0)

 [![elePHPant sleeping on a globe](./docs/source/sleeping-elephpant.svg)](./docs/source/sleeping-elephpant.svg)

REST Certain
============

[](#rest-certain)

 **PHP DSL for easy testing of REST services, with a nod to the Java DSL, REST Assured**

 [![Source Code](https://camo.githubusercontent.com/a1abc017a7a3b72aabfc2874dbda931d2c01a64c07378703107315fa8977aa11/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f736f757263652d726573742d2d6365727461696e2f726573742d2d6365727461696e2d626c75652e7376673f7374796c653d666c61742d737175617265)](https://github.com/rest-certain/rest-certain) [![Download Package](https://camo.githubusercontent.com/7fdeef9ff3fdcba3571f7232c9059ef9710bdb54696319f2c8de529fadae5d29/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f726573742d6365727461696e2f726573742d6365727461696e2e7376673f7374796c653d666c61742d737175617265266c6162656c3d72656c65617365)](https://packagist.org/packages/rest-certain/rest-certain) [![PHP Programming Language](https://camo.githubusercontent.com/1cc2040869bacce6efaa2a5c15b5c1c0e39ddba2f8f6298f38f5ca09142ace71/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f726573742d6365727461696e2f726573742d6365727461696e2e7376673f7374796c653d666c61742d73717561726526636f6c6f72423d253233383839324246)](https://php.net) [![Read License](https://camo.githubusercontent.com/06c5bab7e1185eaff3cd695a2e5c18ff4fdbd03b6d50f1379c0a3dc68d9aedf3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f726573742d6365727461696e2f726573742d6365727461696e2e7376673f7374796c653d666c61742d73717561726526636f6c6f72423d6461726b6379616e)](https://github.com/rest-certain/rest-certain/blob/main/NOTICE) [![Build Status](https://camo.githubusercontent.com/1aa90217176a5f309ea0f6f7e5601d2ca3709336d74fe9f6fd0011c9ce9239e2/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f726573742d6365727461696e2f726573742d6365727461696e2f636f6e74696e756f75732d696e746567726174696f6e2e796d6c3f6272616e63683d6d61696e267374796c653d666c61742d737175617265266c6f676f3d676974687562)](https://github.com/rest-certain/rest-certain/actions/workflows/continuous-integration.yml) [![Codecov Code Coverage](https://camo.githubusercontent.com/0e5b1fb5f41388d1390b0ac1609669a6248cac67a3a3f26efbbc3cfb9efe3e88/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f67682f726573742d6365727461696e2f726573742d6365727461696e3f6c6162656c3d636f6465636f76266c6f676f3d636f6465636f76267374796c653d666c61742d737175617265)](https://codecov.io/gh/rest-certain/rest-certain)

About
-----

[](#about)

REST Certain is a port of [REST Assured](https://github.com/rest-assured/rest-assured)to the PHP programming language. It provides a DSL that aims to simplify and ease the testing of REST services.

This project adheres to a [code of conduct](CODE_OF_CONDUCT.md). By participating in this project and its community, you are expected to uphold this code.

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

[](#installation)

Install this package as a development dependency using [Composer](https://getcomposer.org).

```
composer require --dev rest-certain/rest-certain
```

Usage
-----

[](#usage)

Borrowing from the REST Assured project's examples, here's an example of how to use REST Certain to make a `GET` request and validate a JSON response.

Given the following JSON response body:

```
{
  "lotto":{
    "lottoId": 5,
    "winning-numbers": [2, 45, 34, 23, 7, 5, 3],
    "winners":[{
      "winnerId": 23,
      "numbers": [2, 45, 34, 23, 3, 5]
    },{
      "winnerId": 54,
      "numbers": [52, 3, 12, 11, 18, 22]
    }]
  }
}
```

We can use [JMESPath query language](https://jmespath.org) syntax to assert that `lottoId` is equal to `5`:

```
get('/lotto')->then()->assertThat()->path('lotto.lottoId', is(equalTo(5)));
```

We can also verify all the winner IDs:

```
get('/lotto')->then()->assertThat()
    ->path('lotto.winners[*].winnerId', hasItems(54, 23));
```

Tip

REST Certain supports both [JMESPath](https://jmespath.org) and [JSONPath](https://www.rfc-editor.org/rfc/rfc9535). If the path query begins with a dollar symbol (`$`), REST Certain assumes the query syntax is JSONPath. Otherwise, it assumes the query syntax is JMESPath.

We can also get a lot more complex and expressive with the HTTP requests and assertions we make. For example:

```
given()
    ->accept('application/json')
    ->queryParam('foo', 'bar')
    ->and()->body(['name' => 'Something Cool'])
->when()
    ->put('/something/{id}', ['id' => 123])
->then()
    ->statusCode(200)
    ->and()->header('content-type', 'application/json')
    ->and()->cookie('baz', 'qux')
    ->and()->path('id', 123);
```

REST Certain supports any HTTP method but has explicit support for `POST`, `GET`, `PUT`, `DELETE`, `OPTIONS`, `PATCH`, and `HEAD` and includes specifying and validating parameters, headers, cookies, and body easily.

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

[](#contributing)

Contributions are welcome! To contribute, please familiarize yourself with [CONTRIBUTING.md](CONTRIBUTING.md).

Coordinated Disclosure
----------------------

[](#coordinated-disclosure)

Keeping user information safe and secure is a top priority, and we welcome the contribution of external security researchers. If you believe you've found a security issue in software that is maintained in this repository, please read [SECURITY.md](SECURITY.md) for instructions on submitting a vulnerability report.

Copyright and License
---------------------

[](#copyright-and-license)

REST Certain is copyright © [REST Certain Contributors](https://rest-certain.dev)and licensed for use under the terms of the GNU Lesser General Public License (LGPL-3.0-or-later) as published by the Free Software Foundation. Please see [COPYING.LESSER](COPYING.LESSER), [COPYING](COPYING), and [NOTICE](NOTICE) for more information.

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance67

Regular maintenance activity

Popularity14

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

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

6

Last Release

348d ago

### Community

Maintainers

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

---

Top Contributors

[![ramsey](https://avatars.githubusercontent.com/u/42941?v=4)](https://github.com/ramsey "ramsey (108 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")

---

Tags

apiphpunitresttestingtestingphpunitapirest

###  Code Quality

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/rest-certain-rest-certain/health.svg)

```
[![Health](https://phpackages.com/badges/rest-certain-rest-certain/health.svg)](https://phpackages.com/packages/rest-certain-rest-certain)
```

###  Alternatives

[openai-php/client

OpenAI PHP is a supercharged PHP API client that allows you to interact with the Open AI API

5.8k22.6M232](/packages/openai-php-client)[phpro/http-tools

HTTP tools for developing more consistent HTTP implementations.

28137.8k](/packages/phpro-http-tools)[kreait/firebase-php

Firebase Admin SDK

2.4k39.7M72](/packages/kreait-firebase-php)[getbrevo/brevo-php

Official Brevo provided RESTFul API V3 php library

963.1M35](/packages/getbrevo-brevo-php)[opensearch-project/opensearch-php

PHP Client for OpenSearch

15224.3M65](/packages/opensearch-project-opensearch-php)[swisnl/json-api-client

A PHP package for mapping remote JSON:API resources to Eloquent like models and collections.

211473.2k12](/packages/swisnl-json-api-client)

PHPackages © 2026

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