{"id":22771574,"url":"https://github.com/pschocke/testmacros","last_synced_at":"2026-04-30T01:39:02.975Z","repository":{"id":57045468,"uuid":"228094035","full_name":"pschocke/testmacros","owner":"pschocke","description":"A set of useful Laravel testing macros ","archived":false,"fork":false,"pushed_at":"2019-12-15T21:57:10.000Z","size":30,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-29T08:52:03.050Z","etag":null,"topics":["laravel","macros","php","testing"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pschocke.png","metadata":{"files":{"readme":"readme.md","changelog":"changelog.md","contributing":"contributing.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-12-14T21:54:02.000Z","updated_at":"2019-12-15T21:46:18.000Z","dependencies_parsed_at":"2022-08-24T04:50:25.221Z","dependency_job_id":null,"html_url":"https://github.com/pschocke/testmacros","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pschocke%2Ftestmacros","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pschocke%2Ftestmacros/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pschocke%2Ftestmacros/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pschocke%2Ftestmacros/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pschocke","download_url":"https://codeload.github.com/pschocke/testmacros/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246314149,"owners_count":20757463,"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":["laravel","macros","php","testing"],"created_at":"2024-12-11T16:14:17.546Z","updated_at":"2026-04-30T01:38:57.951Z","avatar_url":"https://github.com/pschocke.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Laravel Test-Macros\n\nThis Package is inspired by Spaties [Laravel Collections](https://github.com/spatie/laravel-collection-macros) package and extends Laravels default Testing methods with a few useful macros.\n\n## Installation\n\nVia Composer\n\n``` bash\n$ composer require pschocke/testmacros --dev\n```\n\nThe package will automatically register itself.\n\n## Macros\n\n### TestResponse\n\n- [`assertResource`](#assertResource)\n- [`asArray`](#asArray)\n- [`resourceAsArray`](#resourceAsArray)\n\n#### `assertResource`\n\nAsserts that a response is a resource\n\n```php\n$model = factory(App\\Model::class)-\u003ecreate();\n\n$this-\u003ejson('GET', '/route/to/resource')-\u003eassertResource(new ModelResource($model));\n```\n\n#### `asArray`\n\nReturns the response of a call\n\n```php\n$responseArray = $this-\u003ejson('GET', '/route/to/response')-\u003easArray();\n```\n#### `ResourceAsArray`\n\nReturns the data attribute of a API resource response\n\n```php\n$responseArray = $this-\u003ejson('GET', '/route/to/resource')-\u003eresourceAsArray();\n```\n\n## Change log\n\nPlease see the [changelog](changelog.md) for more information on what has changed recently.\n\n## Testing\n\n`TODO`\n\n## Contributing\n\nPlease see [contributing.md](contributing.md) for details and a todolist.\n\n## Security\n\nIf you discover any security related issues, please email patrick@ausbildung-ms.de instead of using the issue tracker.\n\n## License\n\nMIT. Please see the [license file](license.md) for more information.\n\n[ico-version]: https://img.shields.io/packagist/v/pschocke/testmacros.svg?style=flat-square\n[ico-downloads]: https://img.shields.io/packagist/dt/pschocke/testmacros.svg?style=flat-square\n[ico-travis]: https://img.shields.io/travis/pschocke/testmacros/master.svg?style=flat-square\n[ico-styleci]: https://styleci.io/repos/12345678/shield\n\n[link-packagist]: https://packagist.org/packages/pschocke/testmacros\n[link-downloads]: https://packagist.org/packages/pschocke/testmacros\n[link-travis]: https://travis-ci.org/pschocke/testmacros\n[link-styleci]: https://styleci.io/repos/12345678\n[link-author]: https://github.com/pschocke\n[link-contributors]: ../../contributors\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpschocke%2Ftestmacros","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpschocke%2Ftestmacros","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpschocke%2Ftestmacros/lists"}