{"id":20827710,"url":"https://github.com/peridot-php/leo-http-foundation","last_synced_at":"2025-07-02T07:36:12.387Z","repository":{"id":24896558,"uuid":"28312932","full_name":"peridot-php/leo-http-foundation","owner":"peridot-php","description":"A leo extension for writing assertions against HttpFoundation","archived":false,"fork":false,"pushed_at":"2019-10-30T15:59:14.000Z","size":175,"stargazers_count":4,"open_issues_count":2,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-06-03T21:34:44.830Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://peridot-php.github.io/leo/","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/peridot-php.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-12-21T20:58:25.000Z","updated_at":"2018-08-10T10:30:09.000Z","dependencies_parsed_at":"2022-08-23T21:00:32.243Z","dependency_job_id":null,"html_url":"https://github.com/peridot-php/leo-http-foundation","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/peridot-php/leo-http-foundation","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peridot-php%2Fleo-http-foundation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peridot-php%2Fleo-http-foundation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peridot-php%2Fleo-http-foundation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peridot-php%2Fleo-http-foundation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/peridot-php","download_url":"https://codeload.github.com/peridot-php/leo-http-foundation/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peridot-php%2Fleo-http-foundation/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263094498,"owners_count":23412977,"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":[],"created_at":"2024-11-17T23:12:49.709Z","updated_at":"2025-07-02T07:36:12.325Z","avatar_url":"https://github.com/peridot-php.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"#Leo Http Foundation\n\n[Leo](http://peridot-php.github.io/leo/) assertions for use with [HttpFoundation](http://symfony.com/doc/current/components/http_foundation/introduction.html)\n\n[![Build Status](https://travis-ci.org/peridot-php/leo-http-foundation.svg?branch=master)](https://travis-ci.org/peridot-php/leo-http-foundation)\n[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/peridot-php/leo-http-foundation/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/peridot-php/leo-http-foundation/?branch=master)\n\nThis set of assertions is evolving as needed. Please feel free to submit pull requests and make\nfeature requests.\n\n##Usage\n\nYou can add HttpFoundation behavior to Leo by extending the Leo `assertion` property.\n\n```php\n$assertion = Leo::assertion();\n$assertion-\u003eextend(new LeoHttpFoundation());\n```\n\n##Assertions\n\n###-\u003eallow(methods, [message])\n\n* @param `array` $methods\n* @param `string` $message [optional]\n\nChecks that the Allowed header is present on the response and that it\ncontains **all** values passed in the `methods` array.\n\n```php\nexpect($response)-\u003eto-\u003eallow(['POST', 'GET']);\nexpect($response)-\u003eto-\u003enot-\u003eallow(['GET']);\n```\n\n###-\u003estatus(status, [message])\n\n* @param `int` $status\n* @param `string` $message [optional]\n\nAsserts that the response status is equal to `status`.\n\n```php\nexpect($response)-\u003eto-\u003ehave-\u003estatus(200);\nexpect($response)-\u003eto-\u003enot-\u003ehave-\u003estatus(400);\n```\n\n###-\u003ejson\n\n* @param `bool` $assoc [optional]\n* @param `int` $depth [optional]\n* @param `int` $options [optional]\n\nA language chain that parses the response body as json and sets it as the subject\nof the assertion chain.  The options parameters for \u003ccode\u003ejson_decode()\u003c/code\u003e may \nalso be included.\n\n```php\nexpect($response)-\u003ejson-\u003eto-\u003ehave-\u003eproperty('name');\nexpect($response)-\u003ejson-\u003eto-\u003eloosely-\u003eequal($expected);\nexpect($response)-\u003ejson(true, 999, JSON_BIGINT_AS_STRING)-\u003eto-\u003eequal($expected);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fperidot-php%2Fleo-http-foundation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fperidot-php%2Fleo-http-foundation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fperidot-php%2Fleo-http-foundation/lists"}