{"id":26950976,"url":"https://github.com/ns3777k/hoverfly-php","last_synced_at":"2025-04-02T23:35:22.588Z","repository":{"id":57028966,"uuid":"201559721","full_name":"ns3777k/hoverfly-php","owner":"ns3777k","description":"PHP Client for hoverfly","archived":false,"fork":false,"pushed_at":"2023-02-19T16:37:41.000Z","size":57,"stargazers_count":1,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-07T15:18:11.277Z","etag":null,"topics":["hoverfly"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ns3777k.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}},"created_at":"2019-08-10T00:47:28.000Z","updated_at":"2023-02-19T16:36:53.000Z","dependencies_parsed_at":"2022-08-23T18:50:13.947Z","dependency_job_id":null,"html_url":"https://github.com/ns3777k/hoverfly-php","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ns3777k%2Fhoverfly-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ns3777k%2Fhoverfly-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ns3777k%2Fhoverfly-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ns3777k%2Fhoverfly-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ns3777k","download_url":"https://codeload.github.com/ns3777k/hoverfly-php/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246911498,"owners_count":20853654,"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":["hoverfly"],"created_at":"2025-04-02T23:35:21.969Z","updated_at":"2025-04-02T23:35:22.581Z","avatar_url":"https://github.com/ns3777k.png","language":"PHP","readme":"# Hoverfly PHP Client\n\n[![Build Status](https://travis-ci.org/ns3777k/hoverfly-php.svg?branch=master)](https://travis-ci.org/ns3777k/hoverfly-php)\n[![codecov](https://codecov.io/gh/ns3777k/hoverfly-php/branch/master/graph/badge.svg)](https://codecov.io/gh/ns3777k/hoverfly-php)\n\nPHP Client for [hoverfly](https://hoverfly.io/) based on [java version](https://github.com/SpectoLabs/hoverfly-java).\n\n## Why I would use it for?\n\nConsider having a functional test that sends a request to the application. While handling the request application can\nuse multiple external services like forecast, billing or booking system. We don't wanna test external services because\nthey are not stable, require an internet connection, can limit request rate per second and add delay. During the test we\njust want **something** to respond to our requests according to the specification, it does not have to be a real service\nand that's where hoverfly and this client come in.\n\n## Installation\n\n```shell script\n$ composer require --dev ns3777k/hoverfly\n```\n\n## Example\n\nYour tests have to be configured to use hoverfly proxy server (use `HTTP_PROXY`) and ignore proxy for itself (use\n`NO_PROXY`).\n\n```php\n\u003c?php\n\nrequire_once __DIR__ . '/vendor/autoload.php';\n\nuse Hoverfly\\Client;\nuse Hoverfly\\Model\\Response;\n\nclass SomeTest\n{\n    private $hoverfly;\n\n    public function __construct()\n    {\n        $this-\u003ehoverfly = new Client(['base_uri' =\u003e getenv('HOVERFLY_URL')]);\n    }\n\n    public function _before()\n    {\n        $this-\u003ehoverfly-\u003edeleteJournal();\n        $this-\u003ehoverfly-\u003edeleteSimulation();\n    }\n\n    public function testFeature(ApiTester $I)\n    {\n        $this-\u003ehoverfly-\u003esimulate(\n            $this-\u003ehoverfly-\u003ebuildSimulation()\n                -\u003eserviceExact('test.ru')\n                -\u003egetExact('/test')\n                -\u003ewithState('customer', 'individual')\n                -\u003ewillReturn(\n                    Response::json(['test' =\u003e true])\n                        -\u003esetDelay(3000)\n                        -\u003eaddTransitionsState('step', 'order')\n                        -\u003eaddTransitionsState('customer', 'individual')\n                        -\u003eaddRemovesState('basket')\n                )\n        );\n\n        $I-\u003esendPOST('/api/v1/faq/9999999/dislike', ['comment' =\u003e 'test']);\n    }\n}\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fns3777k%2Fhoverfly-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fns3777k%2Fhoverfly-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fns3777k%2Fhoverfly-php/lists"}