{"id":50773802,"url":"https://github.com/ghostwriter/phpunit-assertions","last_synced_at":"2026-06-11T21:36:01.579Z","repository":{"id":360723471,"uuid":"1251433151","full_name":"ghostwriter/phpunit-assertions","owner":"ghostwriter","description":"Additional assertions for PHPUnit","archived":false,"fork":false,"pushed_at":"2026-06-07T11:05:56.000Z","size":240,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"0.1.x","last_synced_at":"2026-06-11T21:35:24.467Z","etag":null,"topics":["ghostwriter","php","phpunit-assertions"],"latest_commit_sha":null,"homepage":"https://github.com/ghostwriter/phpunit-assertions","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ghostwriter.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":["ghostwriter"]}},"created_at":"2026-05-27T15:14:41.000Z","updated_at":"2026-06-07T11:05:57.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/ghostwriter/phpunit-assertions","commit_stats":null,"previous_names":["ghostwriter/phpunit-assertions"],"tags_count":0,"template":false,"template_full_name":"ghostwriter/wip","purl":"pkg:github/ghostwriter/phpunit-assertions","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghostwriter%2Fphpunit-assertions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghostwriter%2Fphpunit-assertions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghostwriter%2Fphpunit-assertions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghostwriter%2Fphpunit-assertions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ghostwriter","download_url":"https://codeload.github.com/ghostwriter/phpunit-assertions/tar.gz/refs/heads/0.1.x","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghostwriter%2Fphpunit-assertions/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34219510,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-11T02:00:06.485Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["ghostwriter","php","phpunit-assertions"],"created_at":"2026-06-11T21:36:00.677Z","updated_at":"2026-06-11T21:36:01.566Z","avatar_url":"https://github.com/ghostwriter.png","language":"PHP","funding_links":["https://github.com/sponsors/ghostwriter","https://paypal.me/codepoet"],"categories":[],"sub_categories":[],"readme":"# PHPUnit Assertions\n\n[![Automation](https://github.com/ghostwriter/phpunit-assertions/actions/workflows/automation.yml/badge.svg)](https://github.com/ghostwriter/phpunit-assertions/actions/workflows/automation.yml)\n[![PHP Version](https://badgen.net/packagist/php/ghostwriter/phpunit-assertions?color=777BB4)](https://www.php.net/supported-versions)\n[![Packagist Downloads](https://badgen.net/packagist/dt/ghostwriter/phpunit-assertions?color=F28D1A)](https://packagist.org/packages/ghostwriter/phpunit-assertions)\n[![PayPal](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MzLjQ5OC0uNzEuMTY2IDAgLjI1LS4wOS40MTYtLjA5aDUuNDk0Yy42NjYgMCAxLjMzLjA5IDEuODMuMTc4LjE2NiAwIC4zMzMgMCAuNDk4LjA4OS4xNjguMDg5LjMzNC4wODkuNDE4LjE3OGguMjVjLjI0OC4wODkuNDk3LjI2Ni43NDguMzU1LjI0OC0xLjg2NiAwLTMuMTEtLjk5OS00LjM1NUMxNy43MTcuNTMzIDE1LjgwNCAwIDEzLjM5IDBINi4yMzVjLS40MTggMC0uOTE2LjM1Ni0xIC44ODlMMi4zMjMgMjAuNjIyYzAgLjM1Ni4yNS44LjY2NS44aDQuMzI4bDEuMTY0LTcuMzc4IDEuMDg0LTcuOTF6IiBmaWxsPSIjMDAzMDg3Ii8%2BPC9zdmc%2B)](https://paypal.me/codepoet)\n[![Sponsors via GitHub](https://img.shields.io/github/sponsors/ghostwriter?label=Sponsor+@ghostwriter/phpunit-assertions\u0026logo=GitHub+Sponsors)](https://github.com/sponsors/ghostwriter)\n\nAdditional assertions for PHPUnit\n\n## Installation\n\nYou can install the package via composer:\n\n``` bash\ncomposer require ghostwriter/phpunit-assertions --dev\n```\n\n### Star ⭐️ this repo if you find it useful\n\nYou can also star (🌟) this repo to find it easier later.\n\n## Usage\n\n```php\n\u003c?php\n\ndeclare(strict_types=1);\n\nnamespace Tests\\Unit;\n\nuse PHPUnit\\Framework\\TestCase;\nuse Ghostwriter\\PHPUnitAssertions\\Trait\\ClassAssertionsTrait;\n\nfinal class ExampleTest extends TestCase\n{\n    use ClassAssertionsTrait;\n\n    public function testClassAssertions(): void\n    {\n        self::assertClassHasMethod('invoke', ExampleChild::class);\n        self::assertClassDoesNotHaveMethod('missing', ExampleChild::class);\n        self::assertClassExtendsClass(ExampleChild::class, ExampleBase::class);\n        self::assertClassExtendsClasses(ExampleChild::class, [ExampleBase::class, ExampleRoot::class]);\n        self::assertClassImplementsInterface(ExampleChild::class, ExampleInterface::class);\n        self::assertClassImplementsInterfaces(ExampleChild::class, [ExampleInterface::class, ExampleExtraInterface::class]);\n        self::assertClassUsesTrait(ExampleChild::class, ExampleTraitA::class);\n        self::assertClassUsesTraits(ExampleChild::class, [ExampleTraitA::class, ExampleTraitB::class]);\n    }\n}\n\ninterface ExampleInterface {}\ninterface ExampleExtraInterface {}\ninterface ExampleCompositeInterface extends ExampleInterface, ExampleExtraInterface {}\n\ntrait ExampleTraitA {}\ntrait ExampleTraitB {}\n\nclass ExampleRoot {}\n\nclass ExampleBase extends ExampleRoot\n{\n    use ExampleTraitA;\n\n    public function invoke(): void {}\n}\n\nclass ExampleChild extends ExampleBase implements ExampleCompositeInterface\n{\n    use ExampleTraitB;\n}\n```\n\n## Trait methods\n\n### `ClassAssertionsTrait`\n\n- `ClassAssertionsTrait::assertClassHasMethod`\n- `ClassAssertionsTrait::assertClassDoesNotHaveMethod`\n- `ClassAssertionsTrait::assertClassExtendsClass`\n- `ClassAssertionsTrait::assertClassExtendsClasses`\n- `ClassAssertionsTrait::assertClassImplementsInterface`\n- `ClassAssertionsTrait::assertClassImplementsInterfaces`\n- `ClassAssertionsTrait::assertClassUsesTrait`\n- `ClassAssertionsTrait::assertClassUsesTraits`\n\n### Credits\n\n- [Nathanael Esayeas](https://github.com/ghostwriter)\n- [Sebastian Bergmann](https://github.com/sebastianbergmann) creator of [PHPUnit](https://github.com/sebastianbergmann/phpunit)\n- [All Contributors](https://github.com/ghostwriter/phpunit-assertions/contributors)\n\n### Changelog\n\nPlease see [CHANGELOG.md](./CHANGELOG.md) for more information on what has changed recently.\n\n### License\n\nPlease see [LICENSE](./LICENSE) for more information on the license that applies to this project.\n\n### Security\n\nPlease see [SECURITY.md](./SECURITY.md) for more information on security disclosure process.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fghostwriter%2Fphpunit-assertions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fghostwriter%2Fphpunit-assertions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fghostwriter%2Fphpunit-assertions/lists"}