{"id":24740068,"url":"https://github.com/ubirak/rest-api-behat-extension","last_synced_at":"2025-04-12T23:34:22.068Z","repository":{"id":27226184,"uuid":"30697419","full_name":"ubirak/rest-api-behat-extension","owner":"ubirak","description":"Stuff to easily test your rest api with Behat","archived":false,"fork":false,"pushed_at":"2024-11-27T08:58:04.000Z","size":180,"stargazers_count":39,"open_issues_count":7,"forks_count":24,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-04-12T23:34:16.075Z","etag":null,"topics":["behat","rest-api","test-automation"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"dmpayton/foaas-python","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ubirak.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-02-12T10:24:28.000Z","updated_at":"2025-01-23T16:32:12.000Z","dependencies_parsed_at":"2024-06-18T17:09:19.644Z","dependency_job_id":"010812b9-981b-4ad1-bdac-b08727db5686","html_url":"https://github.com/ubirak/rest-api-behat-extension","commit_stats":{"total_commits":99,"total_committers":19,"mean_commits":"5.2105263157894735","dds":0.4949494949494949,"last_synced_commit":"8bdbcd0fdfe1d609a99e4f9a5eafe2bf3f9aeca7"},"previous_names":[],"tags_count":38,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ubirak%2Frest-api-behat-extension","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ubirak%2Frest-api-behat-extension/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ubirak%2Frest-api-behat-extension/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ubirak%2Frest-api-behat-extension/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ubirak","download_url":"https://codeload.github.com/ubirak/rest-api-behat-extension/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248647259,"owners_count":21139081,"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":["behat","rest-api","test-automation"],"created_at":"2025-01-27T23:20:25.807Z","updated_at":"2025-04-12T23:34:22.045Z","avatar_url":"https://github.com/ubirak.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RestApiExtension for Behat\n* [Branch behat2](https://github.com/ubirak/rest-api-behat-extension/tree/behat-2.x) : **Behat 2.x**\n* [Branch master](https://github.com/ubirak/rest-api-behat-extension/tree/master) : **Behat 3.x**\n\n[![Build Status](https://travis-ci.org/ubirak/rest-api-behat-extension.png?branch=master)](https://travis-ci.org/ubirak/rest-api-behat-extension)\n\n[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/ubirak/rest-api-behat-extension/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/ubirak/rest-api-behat-extension/?branch=master)\n\nFor now only JSON api is supported to analyze response, but you could use REST part to perform request on any type of api.\n\n## Warning\n\nFrom version `7.0`, namespace vendor changed from `Rezzza` to `Ubirak`.\n\n## Install\n\nRequire the package as a development dependency :\n\n```sh\ncomposer require --dev ubirak/rest-api-behat-extension\n```\n\nDon't forget to load the extension and the context if needed in your `behat.yml` :\n```yaml\ndefault:\n    extensions:\n        Ubirak\\RestApiBehatExtension\\Extension:\n            rest:\n                base_url: http://localhost:8888\n                store_response: true\n    suites:\n        default:\n            contexts:\n                - Ubirak\\RestApiBehatExtension\\RestApiContext\n                - Ubirak\\RestApiBehatExtension\\Json\\JsonContext\n```\n\nThen you will need to require in your composer the http client you want to use, and the message factory.\n\nExample:\n```\ncomposer require --dev guzzlehttp/psr7 php-http/curl-client\n```\n\n## Usage\nYou can use directly the `JsonContext` or `RestApiContext` by loading them in your behat.yml or use the `RestApiBrowser` and `JsonInspector` by adding them in the construct of your own context.\n\n```php\n\u003c?php\n/**/\n\nuse Ubirak\\RestApiBehatExtension\\Rest\\RestApiBrowser;\nuse Ubirak\\RestApiBehatExtension\\Json\\JsonInspector;\n\nclass FeatureContext implements Context\n{\n    private $restApiBrowser;\n\n    private $jsonInspector;\n\n    public function __construct(RestApiBrowser $restApiBrowser, JsonInspector $jsonInspector)\n    {\n        $this-\u003erestApiBrowser = $restApiBrowser;\n        $this-\u003ejsonInspector = $jsonInspector;\n    }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fubirak%2Frest-api-behat-extension","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fubirak%2Frest-api-behat-extension","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fubirak%2Frest-api-behat-extension/lists"}