{"id":27939489,"url":"https://github.com/rest-certain/hamcrest-phpunit","last_synced_at":"2026-05-04T07:34:50.338Z","repository":{"id":291691927,"uuid":"978444394","full_name":"rest-certain/hamcrest-phpunit","owner":"rest-certain","description":"Hamcrest matchers that work natively with PHPUnit","archived":false,"fork":false,"pushed_at":"2025-05-06T03:23:06.000Z","size":68,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-05-06T03:33:25.887Z","etag":null,"topics":["hamcrest","hamcrest-matchers","php","phpunit","testing"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rest-certain.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"COPYING","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-05-06T02:07:24.000Z","updated_at":"2025-05-06T03:23:09.000Z","dependencies_parsed_at":"2025-05-06T03:43:30.781Z","dependency_job_id":null,"html_url":"https://github.com/rest-certain/hamcrest-phpunit","commit_stats":null,"previous_names":["rest-certain/hamcrest-phpunit"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rest-certain%2Fhamcrest-phpunit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rest-certain%2Fhamcrest-phpunit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rest-certain%2Fhamcrest-phpunit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rest-certain%2Fhamcrest-phpunit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rest-certain","download_url":"https://codeload.github.com/rest-certain/hamcrest-phpunit/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252856425,"owners_count":21814853,"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":["hamcrest","hamcrest-matchers","php","phpunit","testing"],"created_at":"2025-05-07T09:54:31.438Z","updated_at":"2026-05-04T07:34:50.332Z","avatar_url":"https://github.com/rest-certain.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003erest-certain/hamcrest-phpunit\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003cstrong\u003eHamcrest matchers that work natively with PHPUnit\u003c/strong\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://github.com/rest-certain/hamcrest-phpunit\"\u003e\u003cimg src=\"https://img.shields.io/badge/source-rest--certain/hamcrest--phpunit-blue.svg?style=flat-square\" alt=\"Source Code\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://packagist.org/packages/rest-certain/hamcrest-phpunit\"\u003e\u003cimg src=\"https://img.shields.io/packagist/v/rest-certain/hamcrest-phpunit.svg?style=flat-square\u0026label=release\" alt=\"Download Package\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://php.net\"\u003e\u003cimg src=\"https://img.shields.io/packagist/php-v/rest-certain/hamcrest-phpunit.svg?style=flat-square\u0026colorB=%238892BF\" alt=\"PHP Programming Language\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/rest-certain/hamcrest-phpunit/blob/main/NOTICE\"\u003e\u003cimg src=\"https://img.shields.io/packagist/l/rest-certain/hamcrest-phpunit.svg?style=flat-square\u0026colorB=darkcyan\" alt=\"Read License\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/rest-certain/hamcrest-phpunit/actions/workflows/continuous-integration.yml\"\u003e\u003cimg src=\"https://img.shields.io/github/actions/workflow/status/rest-certain/hamcrest-phpunit/continuous-integration.yml?branch=main\u0026style=flat-square\u0026logo=github\" alt=\"Build Status\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://codecov.io/gh/rest-certain/hamcrest-phpunit\"\u003e\u003cimg src=\"https://img.shields.io/codecov/c/gh/rest-certain/hamcrest-phpunit?label=codecov\u0026logo=codecov\u0026style=flat-square\" alt=\"Codecov Code Coverage\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n## About\n\nThis library provides [Hamcrest](https://hamcrest.org) matchers that return\n[PHPUnit](https://phpunit.de) `Constraint` instances, allowing the matchers to\nbe used anywhere a PHPUnit constraint is allowed.\n\nThis is not an official Hamcrest project and has no affiliation with\n[hamcrest.org](https://hamcrest.org). The *matchers* this library provides are\nnot true Hamcrest matchers in that they do not return Hamcrest `Matcher` instances,\nas [defined by the Hamcrest project](https://hamcrest.org/JavaHamcrest/tutorial#writing-custom-matchers).\nInstead, the functions in this library return `Constraint` instances, for use\nwith PHPUnit.\n\nThis project adheres to a [code of conduct](CODE_OF_CONDUCT.md). By participating\nin this project and its community, you are expected to uphold this code.\n\n\u003e [!TIP]\n\u003e Check out the **official** PHP port of Hamcrest Matchers:\n\u003e [hamcrest/hamcrest-php](https://packagist.org/packages/hamcrest/hamcrest-php)!\n\n## Installation\n\nInstall this package as a development dependency using [Composer](https://getcomposer.org).\n\n``` bash\ncomposer require --dev rest-certain/hamcrest-phpunit\n```\n\n## Usage\n\nThis library provides all Hamcrest matchers as static methods on the\n`RestCertain\\Hamcrest\\Matchers` class and also as functions in the\n`RestCertain\\Hamcrest` namespace. These methods and functions may be used within\nthe context of PHPUnit tests.\n\n``` php\nuse PHPUnit\\Framework\\TestCase;\n\nuse function RestCertain\\Hamcrest\\assertThat;\nuse function RestCertain\\Hamcrest\\both;\nuse function RestCertain\\Hamcrest\\containsStringIgnoringCase;\nuse function RestCertain\\Hamcrest\\isA;\nuse function RestCertain\\Hamcrest\\startsWithIgnoringCase;\n\nclass ExampleTest extends TestCase\n{\n    public function testExample(): void\n    {\n        assertThat(\n            'The quick brown fox jumps over the lazy dog',\n            both(isA('string'))\n                -\u003eand(startsWithIgnoringCase('the'))\n                -\u003eand(containsStringIgnoringCase('FOX')),\n        );\n    }\n}\n```\n\n## Contributing\n\nContributions are welcome! To contribute, please familiarize yourself with\n[CONTRIBUTING.md](CONTRIBUTING.md).\n\n## Coordinated Disclosure\n\nKeeping user information safe and secure is a top priority, and we welcome the\ncontribution of external security researchers. If you believe you've found a\nsecurity issue in software that is maintained in this repository, please read\n[SECURITY.md](SECURITY.md) for instructions on submitting a vulnerability report.\n\n## Copyright and License\n\nrest-certain/hamcrest-phpunit is copyright © [REST Certain Contributors](https://rest-certain.dev)\nand licensed for use under the terms of the GNU Lesser General Public License\n(LGPL-3.0-or-later) as published by the Free Software Foundation. Please see\n[COPYING.LESSER](COPYING.LESSER), [COPYING](COPYING), and [NOTICE](NOTICE) for\nmore information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frest-certain%2Fhamcrest-phpunit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frest-certain%2Fhamcrest-phpunit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frest-certain%2Fhamcrest-phpunit/lists"}