{"id":27939495,"url":"https://github.com/rest-certain/rest-certain","last_synced_at":"2025-08-11T22:36:39.324Z","repository":{"id":289785196,"uuid":"967578078","full_name":"rest-certain/rest-certain","owner":"rest-certain","description":"PHP DSL for easy testing of REST services, with a nod to the Java DSL, REST Assured","archived":false,"fork":false,"pushed_at":"2025-05-06T04:27:31.000Z","size":229,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-06T05:25:37.226Z","etag":null,"topics":["api","phpunit","rest","testing"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rest-certain.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"COPYING","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-04-16T17:08:09.000Z","updated_at":"2025-05-06T05:22:25.000Z","dependencies_parsed_at":null,"dependency_job_id":"958e0a17-3b76-4195-8c26-6935f8f2e71f","html_url":"https://github.com/rest-certain/rest-certain","commit_stats":null,"previous_names":["rest-certain/rest-certain"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rest-certain%2Frest-certain","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rest-certain%2Frest-certain/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rest-certain%2Frest-certain/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rest-certain%2Frest-certain/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rest-certain","download_url":"https://codeload.github.com/rest-certain/rest-certain/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252629488,"owners_count":21779244,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","phpunit","rest","testing"],"created_at":"2025-05-07T09:54:34.013Z","updated_at":"2025-08-11T22:36:39.294Z","avatar_url":"https://github.com/rest-certain.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n    \u003cimg src=\"./docs/source/sleeping-elephpant.svg\" alt=\"elePHPant sleeping on a globe\" width=\"250\"\u003e\n\u003c/p\u003e\n\n\u003ch1 align=\"center\"\u003eREST Certain\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003cstrong\u003ePHP DSL for easy testing of REST services, with a nod to the Java DSL, REST Assured\u003c/strong\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://github.com/rest-certain/rest-certain\"\u003e\u003cimg src=\"https://img.shields.io/badge/source-rest--certain/rest--certain-blue.svg?style=flat-square\" alt=\"Source Code\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://packagist.org/packages/rest-certain/rest-certain\"\u003e\u003cimg src=\"https://img.shields.io/packagist/v/rest-certain/rest-certain.svg?style=flat-square\u0026label=release\" alt=\"Download Package\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://php.net\"\u003e\u003cimg src=\"https://img.shields.io/packagist/php-v/rest-certain/rest-certain.svg?style=flat-square\u0026colorB=%238892BF\" alt=\"PHP Programming Language\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/rest-certain/rest-certain/blob/main/NOTICE\"\u003e\u003cimg src=\"https://img.shields.io/packagist/l/rest-certain/rest-certain.svg?style=flat-square\u0026colorB=darkcyan\" alt=\"Read License\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/rest-certain/rest-certain/actions/workflows/continuous-integration.yml\"\u003e\u003cimg src=\"https://img.shields.io/github/actions/workflow/status/rest-certain/rest-certain/continuous-integration.yml?branch=main\u0026style=flat-square\u0026logo=github\" alt=\"Build Status\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://codecov.io/gh/rest-certain/rest-certain\"\u003e\u003cimg src=\"https://img.shields.io/codecov/c/gh/rest-certain/rest-certain?label=codecov\u0026logo=codecov\u0026style=flat-square\" alt=\"Codecov Code Coverage\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n## About\n\nREST Certain is a port of [REST Assured](https://github.com/rest-assured/rest-assured)\nto the PHP programming language. It provides a DSL that aims to simplify and ease\nthe testing of REST services.\n\nThis project adheres to a [code of conduct](CODE_OF_CONDUCT.md).\nBy participating in this project and its community, you are expected to\nuphold this code.\n\n## Installation\n\nInstall this package as a development dependency using [Composer](https://getcomposer.org).\n\n``` bash\ncomposer require --dev rest-certain/rest-certain\n```\n\n## Usage\n\nBorrowing from the REST Assured project's examples, here's an example of how to\nuse REST Certain to make a `GET` request and validate a JSON response.\n\nGiven the following JSON response body:\n\n``` json\n{\n  \"lotto\":{\n    \"lottoId\": 5,\n    \"winning-numbers\": [2, 45, 34, 23, 7, 5, 3],\n    \"winners\":[{\n      \"winnerId\": 23,\n      \"numbers\": [2, 45, 34, 23, 3, 5]\n    },{\n      \"winnerId\": 54,\n      \"numbers\": [52, 3, 12, 11, 18, 22]\n    }]\n  }\n}\n```\n\nWe can use [JMESPath query language](https://jmespath.org) syntax to assert that\n`lottoId` is equal to `5`:\n\n``` php\nget('/lotto')-\u003ethen()-\u003eassertThat()-\u003epath('lotto.lottoId', is(equalTo(5)));\n```\n\nWe can also verify all the winner IDs:\n\n``` php\nget('/lotto')-\u003ethen()-\u003eassertThat()\n    -\u003epath('lotto.winners[*].winnerId', hasItems(54, 23));\n```\n\n\u003e [!TIP]\n\u003e REST Certain supports both [JMESPath](https://jmespath.org) and\n\u003e [JSONPath](https://www.rfc-editor.org/rfc/rfc9535). If the path query begins\n\u003e with a dollar symbol (`$`), REST Certain assumes the query syntax is JSONPath.\n\u003e Otherwise, it assumes the query syntax is JMESPath.\n\nWe can also get a lot more complex and expressive with the HTTP requests and\nassertions we make. For example:\n\n```php\ngiven()\n    -\u003eaccept('application/json')\n    -\u003equeryParam('foo', 'bar')\n    -\u003eand()-\u003ebody(['name' =\u003e 'Something Cool'])\n-\u003ewhen()\n    -\u003eput('/something/{id}', ['id' =\u003e 123])\n-\u003ethen()\n    -\u003estatusCode(200)\n    -\u003eand()-\u003eheader('content-type', 'application/json')\n    -\u003eand()-\u003ecookie('baz', 'qux')\n    -\u003eand()-\u003epath('id', 123);\n```\n\nREST Certain supports any HTTP method but has explicit support for `POST`, `GET`,\n`PUT`, `DELETE`, `OPTIONS`, `PATCH`, and `HEAD` and includes specifying and\nvalidating parameters, headers, cookies, and body easily.\n\n## Contributing\n\nContributions are welcome! To contribute, please familiarize yourself with\n[CONTRIBUTING.md](CONTRIBUTING.md).\n\n## Coordinated Disclosure\n\nKeeping user information safe and secure is a top priority, and we welcome the\ncontribution of external security researchers. If you believe you've found a\nsecurity issue in software that is maintained in this repository, please read\n[SECURITY.md](SECURITY.md) for instructions on submitting a vulnerability report.\n\n## Copyright and License\n\nREST Certain is copyright © [REST Certain Contributors](https://rest-certain.dev)\nand licensed for use under the terms of the GNU Lesser General Public License\n(LGPL-3.0-or-later) as published by the Free Software Foundation. Please see\n[COPYING.LESSER](COPYING.LESSER), [COPYING](COPYING), and [NOTICE](NOTICE) for\nmore information.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frest-certain%2Frest-certain","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frest-certain%2Frest-certain","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frest-certain%2Frest-certain/lists"}