{"id":49581163,"url":"https://github.com/ergebnis/phpunit-agent-reporter","last_synced_at":"2026-05-03T19:36:22.935Z","repository":{"id":349768249,"uuid":"1198652986","full_name":"ergebnis/phpunit-agent-reporter","owner":"ergebnis","description":"🤖 Provides an extension for reporting phpunit/phpunit test execution details to agents.","archived":false,"fork":false,"pushed_at":"2026-04-22T05:19:32.000Z","size":322,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-22T07:29:41.407Z","etag":null,"topics":["agent","extension","php","phpunit","reporter"],"latest_commit_sha":null,"homepage":null,"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/ergebnis.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":".github/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":["ergebnis","localheinz"]}},"created_at":"2026-04-01T16:17:17.000Z","updated_at":"2026-04-22T05:18:58.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/ergebnis/phpunit-agent-reporter","commit_stats":null,"previous_names":["ergebnis/phpunit-agent-reporter"],"tags_count":2,"template":false,"template_full_name":"ergebnis/php-package-template","purl":"pkg:github/ergebnis/phpunit-agent-reporter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ergebnis%2Fphpunit-agent-reporter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ergebnis%2Fphpunit-agent-reporter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ergebnis%2Fphpunit-agent-reporter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ergebnis%2Fphpunit-agent-reporter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ergebnis","download_url":"https://codeload.github.com/ergebnis/phpunit-agent-reporter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ergebnis%2Fphpunit-agent-reporter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32582845,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-03T06:36:36.687Z","status":"ssl_error","status_checked_at":"2026-05-03T06:36:09.306Z","response_time":103,"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":["agent","extension","php","phpunit","reporter"],"created_at":"2026-05-03T19:36:20.114Z","updated_at":"2026-05-03T19:36:22.925Z","avatar_url":"https://github.com/ergebnis.png","language":"PHP","funding_links":["https://github.com/sponsors/ergebnis","https://github.com/sponsors/localheinz"],"categories":[],"sub_categories":[],"readme":"# phpunit-agent-reporter\n\n[![Integrate](https://github.com/ergebnis/phpunit-agent-reporter/workflows/Integrate/badge.svg)](https://github.com/ergebnis/phpunit-agent-reporter/actions)\n[![Merge](https://github.com/ergebnis/phpunit-agent-reporter/workflows/Merge/badge.svg)](https://github.com/ergebnis/phpunit-agent-reporter/actions)\n[![Nightly](https://github.com/ergebnis/phpunit-agent-reporter/workflows/Nightly/badge.svg)](https://github.com/ergebnis/phpunit-agent-reporter/actions)\n[![Release](https://github.com/ergebnis/phpunit-agent-reporter/workflows/Release/badge.svg)](https://github.com/ergebnis/phpunit-agent-reporter/actions)\n[![Renew](https://github.com/ergebnis/phpunit-agent-reporter/workflows/Renew/badge.svg)](https://github.com/ergebnis/phpunit-agent-reporter/actions)\n\n[![Code Coverage](https://codecov.io/gh/ergebnis/phpunit-agent-reporter/branch/main/graph/badge.svg)](https://codecov.io/gh/ergebnis/phpunit-agent-reporter)\n\n[![Latest Stable Version](https://poser.pugx.org/ergebnis/phpunit-agent-reporter/v/stable)](https://packagist.org/packages/ergebnis/phpunit-agent-reporter)\n[![Total Downloads](https://poser.pugx.org/ergebnis/phpunit-agent-reporter/downloads)](https://packagist.org/packages/ergebnis/phpunit-agent-reporter)\n[![Monthly Downloads](http://poser.pugx.org/ergebnis/phpunit-agent-reporter/d/monthly)](https://packagist.org/packages/ergebnis/phpunit-agent-reporter)\n\nThis project provides a [`composer`](https://getcomposer.org) package and a [Phar archive](https://www.php.net/manual/en/book.phar.php) with an extension for reporting [`phpunit/phpunit`](https://github.com/sebastianbergmann/phpunit) test execution details to agents.\n\n## Example\n\nAfter installing and bootstrapping the extension, when running your tests with `phpunit/phpunit`, the extension will detect whether an agent is running the tests and replace the default output with test execution details that are easier for agents to consume.\n\nWhen tests pass, the extension outputs:\n\n```json\n{\n    \"result\": \"success\",\n    \"summary\": {\n        \"assertions\": 5,\n        \"errors\": 0,\n        \"failures\": 0,\n        \"tests\": 5,\n        \"warnings\": 0\n    }\n}\n```\n\nWhen tests fail (exit code 1), the extension outputs:\n\n```json\n{\n    \"result\": \"failure\",\n    \"summary\": {\n        \"assertions\": 5,\n        \"errors\": 0,\n        \"failures\": 2,\n        \"tests\": 5,\n        \"warnings\": 0\n    },\n    \"details\": {\n        \"failures\": [\n            {\n                \"file\": \"/path/to/ExampleTest.php\",\n                \"line\": 27,\n                \"message\": \"Failed asserting that false is true.\",\n                \"test\": \"Namespace\\\\ExampleTest::testFailing\"\n            },\n            {\n                \"actual\": \"bar\",\n                \"diff\": \"--- Expected\\n+++ Actual\\n@@ @@\\n-'foo'\\n+'bar'\\n\",\n                \"expected\": \"foo\",\n                \"file\": \"/path/to/ExampleTest.php\",\n                \"line\": 34,\n                \"message\": \"Failed asserting that two strings are identical.\",\n                \"test\": \"Namespace\\\\ExampleTest::testComparisonFailing\"\n            }\n        ]\n    }\n}\n```\n\nWhen tests fail with comparison assertions, the `actual`, `diff`, and `expected` fields provide details about the mismatch. These fields are only present for comparison failures.\n\nWhen tests error (exit code 2), the extension outputs:\n\n```json\n{\n    \"result\": \"exception\",\n    \"summary\": {\n        \"assertions\": 5,\n        \"errors\": 1,\n        \"failures\": 2,\n        \"tests\": 5,\n        \"warnings\": 0\n    },\n    \"details\": {\n        \"errors\": [\n            {\n                \"file\": \"/path/to/ExampleTest.php\",\n                \"line\": 32,\n                \"message\": \"Something went wrong.\",\n                \"test\": \"Namespace\\\\ExampleTest::testErroring\"\n            }\n        ],\n        \"failures\": [\n            {\n                \"file\": \"/path/to/ExampleTest.php\",\n                \"line\": 27,\n                \"message\": \"Failed asserting that false is true.\",\n                \"test\": \"Namespace\\\\ExampleTest::testFailing\"\n            },\n            {\n                \"actual\": \"bar\",\n                \"diff\": \"--- Expected\\n+++ Actual\\n@@ @@\\n-'foo'\\n+'bar'\\n\",\n                \"expected\": \"foo\",\n                \"file\": \"/path/to/ExampleTest.php\",\n                \"line\": 34,\n                \"message\": \"Failed asserting that two strings are identical.\",\n                \"test\": \"Namespace\\\\ExampleTest::testComparisonFailing\"\n            }\n        ]\n    }\n}\n```\n\nThe JSON output conforms to the [JSON schema](schema/agent-report-schema.json) included in this package.\n\n### Agent Detection\n\nThe extension uses [`ergebnis/agent-detector`](https://github.com/ergebnis/agent-detector) to detect the presence of agents.\n\n## Compatibility\n\nThe extension is compatible with the following versions of `phpunit/phpunit`:\n\n- [`phpunit/phpunit:^13.0.0`](https://github.com/sebastianbergmann/phpunit/tree/13.0.0)\n- [`phpunit/phpunit:^12.0.0`](https://github.com/sebastianbergmann/phpunit/tree/12.0.0)\n- [`phpunit/phpunit:^11.0.0`](https://github.com/sebastianbergmann/phpunit/tree/11.0.0)\n- [`phpunit/phpunit:^10.0.0`](https://github.com/sebastianbergmann/phpunit/tree/10.0.0)\n\n## Installation\n\n### Installation with `composer`\n\nRun\n\n```sh\ncomposer require --dev ergebnis/phpunit-agent-reporter\n```\n\nto install `ergebnis/phpunit-agent-reporter` as a `composer` package.\n\n### Installation as Phar\n\nDownload `phpunit-agent-reporter.phar` from the [latest release](https://github.com/ergebnis/phpunit-agent-reporter/releases/latest).\n\n## Usage\n\n### Bootstrapping the extension\n\nBefore the extension can report test execution details in `phpunit/phpunit`, you need to bootstrap it.\n\n### Bootstrapping the extension as a `composer` package\n\nTo bootstrap the extension as a `composer` package when using\n\n- `phpunit/phpunit:^13.0.0`\n- `phpunit/phpunit:^12.0.0`\n- `phpunit/phpunit:^11.0.0`\n- `phpunit/phpunit:^10.0.0`\n\nadjust your `phpunit.xml` configuration file and configure the\n\n- [`extensions` element](https://docs.phpunit.de/en/13.0/configuration.html#the-extensions-element) on [`phpunit/phpunit:^13.0.0`](https://docs.phpunit.de/en/13.0/)\n- [`extensions` element](https://docs.phpunit.de/en/12.0/configuration.html#the-extensions-element) on [`phpunit/phpunit:^12.0.0`](https://docs.phpunit.de/en/12.0/)\n- [`extensions` element](https://docs.phpunit.de/en/11.0/configuration.html#the-extensions-element) on [`phpunit/phpunit:^11.0.0`](https://docs.phpunit.de/en/11.0/)\n- [`extensions` element](https://docs.phpunit.de/en/10.5/configuration.html#the-extensions-element) on [`phpunit/phpunit:^10.0.0`](https://docs.phpunit.de/en/10.5/)\n\n```diff\n \u003cphpunit\n     xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n     xsi:noNamespaceSchemaLocation=\"vendor/phpunit/phpunit/phpunit.xsd\"\n     bootstrap=\"vendor/autoload.php\"\n \u003e\n+    \u003cextensions\u003e\n+        \u003cbootstrap class=\"Ergebnis\\PHPUnit\\AgentReporter\\Extension\"/\u003e\n+    \u003c/extensions\u003e\n     \u003ctestsuites\u003e\n         \u003ctestsuite name=\"unit\"\u003e\n             \u003cdirectory\u003etest/Unit/\u003c/directory\u003e\n         \u003c/testsuite\u003e\n     \u003c/testsuites\u003e\n \u003c/phpunit\u003e\n```\n\n### Bootstrapping the extension as a PHAR\n\nTo bootstrap the extension as a PHAR when using\n\n- `phpunit/phpunit:^13.0.0`\n- `phpunit/phpunit:^12.0.0`\n- `phpunit/phpunit:^11.0.0`\n- `phpunit/phpunit:^10.0.0`\n\nadjust your `phpunit.xml` configuration file and configure the\n\n- [`extensionsDirectory` attribute](https://docs.phpunit.de/en/13.0/configuration.html#the-extensionsdirectory-attribute) and the [`extensions` element](https://docs.phpunit.de/en/13.0/configuration.html#the-extensions-element) on [`phpunit/phpunit:^13.0.0`](https://docs.phpunit.de/en/13.0/)\n- [`extensionsDirectory` attribute](https://docs.phpunit.de/en/12.0/configuration.html#the-extensionsdirectory-attribute) and the [`extensions` element](https://docs.phpunit.de/en/12.0/configuration.html#the-extensions-element) on [`phpunit/phpunit:^12.0.0`](https://docs.phpunit.de/en/12.0/)\n- [`extensionsDirectory` attribute](https://docs.phpunit.de/en/11.0/configuration.html#the-extensionsdirectory-attribute) and the [`extensions` element](https://docs.phpunit.de/en/11.0/configuration.html#the-extensions-element) on [`phpunit/phpunit:^11.0.0`](https://docs.phpunit.de/en/11.0/)\n- [`extensionsDirectory` attribute](https://docs.phpunit.de/en/10.5/configuration.html#the-extensionsdirectory-attribute) and the [`extensions` element](https://docs.phpunit.de/en/10.5/configuration.html#the-extensions-element) on [`phpunit/phpunit:^10.0.0`](https://docs.phpunit.de/en/10.5/)\n\n```diff\n \u003cphpunit\n     xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n     xsi:noNamespaceSchemaLocation=\"vendor/phpunit/phpunit/phpunit.xsd\"\n     bootstrap=\"vendor/autoload.php\"\n+    extensionsDirectory=\"directory/where/you/saved/the/extension/phars\"\n \u003e\n+    \u003cextensions\u003e\n+        \u003cbootstrap class=\"Ergebnis\\PHPUnit\\AgentReporter\\Extension\"/\u003e\n+    \u003c/extensions\u003e\n     \u003ctestsuites\u003e\n         \u003ctestsuite name=\"unit\"\u003e\n             \u003cdirectory\u003etest/Unit/\u003c/directory\u003e\n         \u003c/testsuite\u003e\n     \u003c/testsuites\u003e\n \u003c/phpunit\u003e\n```\n\n## Changelog\n\nThe maintainers of this project record notable changes to this project in a [changelog](CHANGELOG.md).\n\n## Contributing\n\nThe maintainers of this project suggest following the [contribution guide](.github/CONTRIBUTING.md).\n\n## Code of Conduct\n\nThe maintainers of this project ask contributors to follow the [code of conduct](.github/CODE_OF_CONDUCT.md).\n\n## General Support Policy\n\nThe maintainers of this project provide limited support.\n\nYou can support the maintenance of this project by [sponsoring @ergebnis](https://github.com/sponsors/ergebnis).\n\n## PHP Version Support Policy\n\nThis project currently supports the following PHP versions:\n\n- [PHP 8.1](https://www.php.net/releases/#8.1.0) (has reached its end of life on December 31, 2025)\n- [PHP 8.2](https://www.php.net/releases/#8.2.0)\n- [PHP 8.3](https://www.php.net/releases/#8.3.0)\n- [PHP 8.4](https://www.php.net/releases/#8.4.0)\n- [PHP 8.5](https://www.php.net/releases/#8.5.0)\n\nThe maintainers of this project add support for a PHP version following its initial release and _may_ drop support for a PHP version when it has reached its [end of life](https://www.php.net/supported-versions.php).\n\n## Security Policy\n\nThis project has a [security policy](.github/SECURITY.md).\n\n## License\n\nThis project uses the [MIT license](LICENSE.md).\n\n## Credits\n\nThis package is inspired by [`nunomaduro/pao`](https://github.com/nunomaduro/pao), originally licensed under MIT by [Nuno Maduro](https://github.com/nunomaduro).\n\n## Social\n\nFollow [@localheinz](https://twitter.com/intent/follow?screen_name=localheinz) and [@ergebnis](https://twitter.com/intent/follow?screen_name=ergebnis) on Twitter.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fergebnis%2Fphpunit-agent-reporter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fergebnis%2Fphpunit-agent-reporter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fergebnis%2Fphpunit-agent-reporter/lists"}