{"id":34011195,"url":"https://github.com/trinet-at/mezzio-test","last_synced_at":"2026-04-01T19:18:33.910Z","repository":{"id":43656937,"uuid":"234633141","full_name":"trinet-at/mezzio-test","owner":"trinet-at","description":"Testing helpers for mezzio projects","archived":false,"fork":false,"pushed_at":"2025-01-11T13:55:51.000Z","size":37,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2026-03-27T15:38:28.185Z","etag":null,"topics":["assertions","hacktoberfest","mezzio","mezzio-test","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/trinet-at.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2020-01-17T20:46:13.000Z","updated_at":"2026-01-04T06:51:46.000Z","dependencies_parsed_at":"2025-01-11T14:34:23.917Z","dependency_job_id":"33147572-a0d1-46f2-94a7-0e68508e25c3","html_url":"https://github.com/trinet-at/mezzio-test","commit_stats":{"total_commits":16,"total_committers":3,"mean_commits":5.333333333333333,"dds":0.375,"last_synced_commit":"36923634fa3efede6e9100787fbe0f1b84b2e1ba"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/trinet-at/mezzio-test","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trinet-at%2Fmezzio-test","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trinet-at%2Fmezzio-test/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trinet-at%2Fmezzio-test/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trinet-at%2Fmezzio-test/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/trinet-at","download_url":"https://codeload.github.com/trinet-at/mezzio-test/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trinet-at%2Fmezzio-test/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31051734,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-27T16:55:14.406Z","status":"ssl_error","status_checked_at":"2026-03-27T16:55:07.885Z","response_time":164,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["assertions","hacktoberfest","mezzio","mezzio-test","php","testing"],"created_at":"2025-12-13T12:31:25.187Z","updated_at":"2026-04-01T19:18:33.898Z","avatar_url":"https://github.com/trinet-at.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Check Build](https://github.com/trinet-at/mezzio-test/workflows/Check%20Build/badge.svg)\n\n# mezzio-test\n\n`mezzio-test` provides classes and tools to help testing [mezzio](https://github.com/mezzio/mezzio) applications.\nIts API aims to be similar to [`laminas-test`](https://github.com/laminas/laminas-test) to ease migration\nfrom Laminas MVC to Mezzio.\n\nThe package is not bound to any testing framework as it does not do any assertions. Instead it just bootstraps\nthe `Container` and `Application` based on your config file. Config file locations default to the\n[mezzio-skeleton](https://github.com/mezzio/mezzio-skeleton), but can be reconfigured.\n\nAlso, a `TestConfigProvider` is provided for loading custom testing configuration\n(custom database, custom container configuration, ...).\n\n## Usage\n\nInstantiate the `\\Trinet\\MezzioTest\\MezzioTestEnvironment` class in your test setup:\n```php\nprotected function setUp(): void\n{\n    parent::setUp();\n    $this-\u003emezzioApp = new MezzioTestEnvironment();\n}\n```\nThis will build your application container, bootstrap the mezzio Application (pipeline, routes) and\nregisters a custom `\\Laminas\\Stratigility\\Middleware\\ErrorHandler` listener, which will just re-throw\nany exception. Thus, the native exception assertions can be used (eg. `$this-\u003eexpectException()` in PHPUnit).\n\nCurrently, the Test environment offers three possibilities to dispatch a request:\n* `dispatch(UriInterface|string $uri, ?string $method = null, array $params = [], array $headers = []): ResponseInterface`:\ndispatch any URI with the given method (defaults to `GET`). `$params` will be used as query parameters for `GET`\nand as parsed body for `POST` requests.\n* `dispatchRoute(string $routeName, array $routeParams = [], string $method = null, array $requestParams = [], array $headers = []): ResponseInterface`:\ndispatch a given named route\n* `dispatchRequest(ServerRequestInterface $request): ResponseInterface`: dispatch a `ServerRequestInterface`\n\nIf your base directory is not at the default location, a constructor parameter can be given to `MezzioTestEnvironment`.\n\nThe container and router can also be retrieved with `MezzioTestEnvironment-\u003econtainer()` and `-\u003erouter()`, respectively.\n\n### Configuration\nThe `\\Trinet\\MezzioTest\\TestConfigProvider` can be used to load additional config files used for testing.\nIt will look for `*testing.php`, `*testing.local.php`, `testing/*testing.php` and `testing/*testing.local.php`\nin the config directory, which defaults to `config/autoload/` in your project root, but can be configured\nto anything else.\n\nTo use it, call the loader when in testing mode in your `config/config.php` file to get an array of providers:\n```php\n$providers = [\n    \\A\\ConfigProvider::class,\n    \\B\\ConfigProvider::class,\n    // ...\n];\n\nif (getenv('APP_TESTING') !== false) {\n    $providers = array_merge($providers, \\Trinet\\MezzioTest\\TestConfigProvider::load());\n}\n\n$aggregator = new ConfigAggregator($providers, null, []);\n```\nor to use another config path:\n```php\n$providers = [\n    \\A\\ConfigProvider::class,\n    \\B\\ConfigProvider::class,\n    // ...\n];\n\nif (getenv('APP_TESTING') !== false) {\n    $providers = array_merge($providers, \\Trinet\\MezzioTest\\TestConfigProvider::load('custom/path'));\n}\n\n$aggregator = new ConfigAggregator($providers, null, []);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrinet-at%2Fmezzio-test","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftrinet-at%2Fmezzio-test","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrinet-at%2Fmezzio-test/lists"}