{"id":18594465,"url":"https://github.com/bauhausphp/assert-psr-response","last_synced_at":"2025-11-02T03:30:33.886Z","repository":{"id":36969918,"uuid":"116513854","full_name":"bauhausphp/assert-psr-response","owner":"bauhausphp","description":"PHP package with class to assert PSR-7 responses","archived":false,"fork":false,"pushed_at":"2023-03-09T06:56:48.000Z","size":97,"stargazers_count":0,"open_issues_count":3,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-26T20:28:02.932Z","etag":null,"topics":["assertion","psr-7"],"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/bauhausphp.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":"2018-01-06T20:36:37.000Z","updated_at":"2020-08-10T11:53:54.000Z","dependencies_parsed_at":"2024-12-26T20:28:08.879Z","dependency_job_id":"4d97f784-8688-4fc5-bec8-b487b9143073","html_url":"https://github.com/bauhausphp/assert-psr-response","commit_stats":{"total_commits":69,"total_committers":5,"mean_commits":13.8,"dds":"0.26086956521739135","last_synced_commit":"c645bdaa3e6cae7877ae36b6614026973cb55b28"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bauhausphp%2Fassert-psr-response","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bauhausphp%2Fassert-psr-response/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bauhausphp%2Fassert-psr-response/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bauhausphp%2Fassert-psr-response/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bauhausphp","download_url":"https://codeload.github.com/bauhausphp/assert-psr-response/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239376353,"owners_count":19628340,"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":["assertion","psr-7"],"created_at":"2024-11-07T01:15:40.776Z","updated_at":"2025-11-02T03:30:33.809Z","avatar_url":"https://github.com/bauhausphp.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://img.shields.io/github/workflow/status/bauhausphp/assert-psr-response/Build?style=flat-square)](https://github.com/bauhausphp/assert-psr-response/actions?query=workflow%3ABuild)\n[![Coverage](https://img.shields.io/codecov/c/github/bauhausphp/assert-psr-response?style=flat-square)](https://codecov.io/gh/bauhausphp/assert-psr-response)\n\n[![Stable Version](https://img.shields.io/packagist/v/bauhaus/assert-psr-response?style=flat-square)](https://packagist.org/packages/bauhaus/assert-psr-response)\n[![Downloads](https://img.shields.io/packagist/dt/bauhaus/assert-psr-response?style=flat-square)](https://packagist.org/packages/bauhaus/assert-psr-response)\n[![PHP Version](https://img.shields.io/packagist/php-v/bauhaus/assert-psr-response?style=flat-square)](composer.json)\n[![License](https://img.shields.io/github/license/bauhausphp/assert-psr-response?style=flat-square)](LICENSE)\n\n# Assert PSR Response\n\nThis composer package aims to provide an easy way to assert\n[PSR-7](http://www.php-fig.org/psr/psr-7/) responses.\n\n## Motivation\n\nI created this package because my constant need of asserting only certain values\nof PSR responses during acceptance tests.\n\n## Installation\n\nInstall it using [Composer](https://getcomposer.org/):\n\n```shell\n$ composer require bauhaus/assert-psr-response\n```\n\n## Usage\n\n```php\n\u003c?php\n\nuse Bauhaus\\PsrResponseAssertion\\PsrResponseAssertion;\nuse Bauhaus\\PsrResponseAssertion\\Matchers\\HeaderLine;\nuse Bauhaus\\PsrResponseAssertion\\Matchers\\StatusCode;\n\n$assertion = PsrResponseAssertion::with(\n   StatusCode::equalTo(200),\n   HeaderLine::equalTo('Content-Type', 'application/json')\n);\n\n$psrResponse = // retrieve it from somewhere ...\n$psrResponse = $psrResponse\n   -\u003ewithStatus(404)\n   -\u003ewithHeader('Content-Type', 'text/html');\n\n$assertion-\u003eassert($psrResponse);\n// throw PsrResponseAssertionException with message:\n// Actual response status code '404' is not equal to the expected '200'\n// Actual response header line 'Content-Type' 'text/html' is not equal to the expected 'application/json'\n```\n\n## Available Matchers\n\n- `StatusCode::equalTo(200)`\n- `HeaderLine::equalTo('Header-Name', 'Header-Value')`\n- `JsonBody::equalTo('{\"field\":\"value\"}')`\n\n## Contribution\n\nThere is two ways to contribute with this project. The first one is by opening\nan issue [here](https://github.com/bauhausphp/assert-psr-response/issues). The second\none is by coding:\n\n1. Fork this project and clone it on your local dev environment\n2. Install dependencies throught the command: `composer install`\n3. Run the locally tests before ubmiting a pull request:\n  * To test code standards: `composer run test:cs`\n  * To run unit tests: `composer run test:unit`\n  * To run all tests in a roll: `composer run tests`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbauhausphp%2Fassert-psr-response","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbauhausphp%2Fassert-psr-response","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbauhausphp%2Fassert-psr-response/lists"}