{"id":13828324,"url":"https://github.com/blastcloud/guzzler","last_synced_at":"2025-04-12T19:52:25.143Z","repository":{"id":44929598,"uuid":"169682118","full_name":"blastcloud/guzzler","owner":"blastcloud","description":"Supercharge your app or SDK with a testing library specifically for Guzzle","archived":false,"fork":false,"pushed_at":"2024-02-20T03:56:33.000Z","size":645,"stargazers_count":272,"open_issues_count":1,"forks_count":3,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-03T23:11:37.845Z","etag":null,"topics":["guzzlehttp","mock","php","phpunit","testing"],"latest_commit_sha":null,"homepage":"https://guzzler.dev","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/blastcloud.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","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":"2019-02-08T03:58:30.000Z","updated_at":"2025-03-11T20:26:14.000Z","dependencies_parsed_at":"2023-11-27T17:47:23.087Z","dependency_job_id":"b9707867-8a40-4dce-971b-0153ba083545","html_url":"https://github.com/blastcloud/guzzler","commit_stats":{"total_commits":123,"total_committers":4,"mean_commits":30.75,"dds":"0.16260162601626016","last_synced_commit":"526240323753e58ec7d6d8e0a2b17117f899273d"},"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blastcloud%2Fguzzler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blastcloud%2Fguzzler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blastcloud%2Fguzzler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blastcloud%2Fguzzler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/blastcloud","download_url":"https://codeload.github.com/blastcloud/guzzler/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248625506,"owners_count":21135513,"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":["guzzlehttp","mock","php","phpunit","testing"],"created_at":"2024-08-04T09:02:41.426Z","updated_at":"2025-04-12T19:52:25.118Z","avatar_url":"https://github.com/blastcloud.png","language":"PHP","readme":"\u003cp style=\"text-align:center;\"\u003e\u003cimg src=\"Guzzler-logo.svg\" width=\"450\"\u003e\u003c/p\u003e\n\u003ca href=\"#\"\u003e\n    \u003cimg src=\"https://github.com/blastcloud/guzzler/actions/workflows/run-tests.yml/badge.svg\" /\u003e\n\u003c/a\u003e\n\u003ca href=\"#\"\u003e\n    \u003cimg src=\"https://poser.pugx.org/blastcloud/guzzler/v/stable\" /\u003e\n\u003c/a\u003e\n\u003ca href=\"https://packagist.org/packages/blastcloud/guzzler/stats\"\u003e\n    \u003cimg src=\"https://poser.pugx.org/blastcloud/guzzler/downloads\" /\u003e\n\u003c/a\u003e\n\u003ca href=\"https://codeclimate.com/github/blastcloud/guzzler/maintainability\"\u003e\n    \u003cimg src=\"https://api.codeclimate.com/v1/badges/01c6f66eaa5db02e5411/maintainability\" /\u003e\n\u003c/a\u003e\n\u003ca href=\"https://github.com/blastcloud/guzzler/blob/master/LICENSE.md\"\u003e\n    \u003cimg src=\"https://poser.pugx.org/blastcloud/guzzler/license\" /\u003e\n\u003c/a\u003e\n\n---\n\n\u003e Full Documentation at [guzzler.dev](https://guzzler.dev)\n\nSupercharge your app or SDK with a testing library specifically for Guzzle. Guzzler covers the process of setting up a mock handler, recording history of requests, and provides several convenience methods for creating expectations and assertions on that history.\n\n## Installation\n\n```bash\ncomposer require --dev --prefer-dist blastcloud/guzzler\n```\n\n## Example Usage\n\n```php\n\u003c?php\n\nuse BlastCloud\\Guzzler\\UsesGuzzler;\nuse GuzzleHttp\\Client;\n\nclass SomeTest extends TestCase\n{\n    use UsesGuzzler;\n\n    public $classToTest;\n\n    public function setUp(): void\n    {\n        parent::setUp();\n    \n        $client = $this-\u003eguzzler-\u003egetClient([\n            /* Any configs for a client */\n            \"base_uri\" =\u003e \"https://example.com/api\"\n        ]);\n        \n        // You can then inject this client object into your code or IOC container.\n        $this-\u003eclassToTest = new ClassToTest($client);\n    }\n\n    public function testSomethingWithExpectations()\n    {\n        $this-\u003eguzzler-\u003eexpects($this-\u003eonce())\n            -\u003epost(\"/some-url\")\n            -\u003ewithHeader(\"X-Authorization\", \"some-key\")\n            -\u003ewillRespond(new Response(201));\n    \n        $this-\u003eclassToTest-\u003esomeMethod();\n    }\n\n    public function testSomethingWithAssertions()\n    {\n        $this-\u003eguzzler-\u003equeueResponse(\n            new Response(204),\n            new \\Exception(\"Some message\"),\n            // any needed responses to return from the client.\n        );\n    \n        $this-\u003eclassToTest-\u003esomeMethod();\n        // ... Some other number of calls\n    \n        $this-\u003eguzzler-\u003eassertAll(function ($expect) {\n            return $expect-\u003ewithHeader(\"Authorization\", \"some-key\");\n        });\n    }\n}\n```\n\n## Documentation\n\n[Full Documentation](https://guzzler.dev)\n\n## License\n\nGuzzler is open-source software licensed under the [MIT License](https://opensource.org/licenses/MIT).\n","funding_links":[],"categories":["PHP"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblastcloud%2Fguzzler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblastcloud%2Fguzzler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblastcloud%2Fguzzler/lists"}