{"id":13607950,"url":"https://github.com/robiningelbrecht/phpunit-pretty-print","last_synced_at":"2025-04-13T06:41:11.525Z","repository":{"id":149476929,"uuid":"621290531","full_name":"robiningelbrecht/phpunit-pretty-print","owner":"robiningelbrecht","description":"Better PHPUnit CLI output with Collision","archived":false,"fork":false,"pushed_at":"2024-02-19T19:11:44.000Z","size":829,"stargazers_count":62,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-04-25T11:01:55.342Z","etag":null,"topics":["php8","phpunit10","pretty-print","testing","website"],"latest_commit_sha":null,"homepage":"https://packagist.org/packages/robiningelbrecht/phpunit-pretty-print","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/robiningelbrecht.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":"robiningelbrecht","custom":["https://www.buymeacoffee.com/ingelbrecht"]}},"created_at":"2023-03-30T11:19:05.000Z","updated_at":"2024-03-04T14:34:50.000Z","dependencies_parsed_at":null,"dependency_job_id":"5309c5fc-3887-4498-85ad-a70f5b1c4d02","html_url":"https://github.com/robiningelbrecht/phpunit-pretty-print","commit_stats":{"total_commits":53,"total_committers":3,"mean_commits":"17.666666666666668","dds":0.1132075471698113,"last_synced_commit":"5d42dbf9d92a6299d3307d59b1a67c9eba22e065"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robiningelbrecht%2Fphpunit-pretty-print","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robiningelbrecht%2Fphpunit-pretty-print/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robiningelbrecht%2Fphpunit-pretty-print/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robiningelbrecht%2Fphpunit-pretty-print/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/robiningelbrecht","download_url":"https://codeload.github.com/robiningelbrecht/phpunit-pretty-print/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248675434,"owners_count":21143763,"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":["php8","phpunit10","pretty-print","testing","website"],"created_at":"2024-08-01T19:01:23.049Z","updated_at":"2025-04-13T06:41:11.499Z","avatar_url":"https://github.com/robiningelbrecht.png","language":"PHP","funding_links":["https://github.com/sponsors/robiningelbrecht","https://www.buymeacoffee.com/ingelbrecht"],"categories":["PHP"],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003eBetter PHPUnit CLI output\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n\t\u003cimg src=\"readme/logo.png\" alt=\"PHPUnit\"\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n\u003ca href=\"https://github.com/robiningelbrecht/phpunit-pretty-print/actions/workflows/ci.yml\"\u003e\u003cimg src=\"https://github.com/robiningelbrecht/phpunit-pretty-print/actions/workflows/ci.yml/badge.svg\" alt=\"CI\"\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/robiningelbrecht/phpunit-pretty-print/blob/master/LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/github/license/robiningelbrecht/phpunit-pretty-print?color=428f7e\u0026logo=open%20source%20initiative\u0026logoColor=white\" alt=\"License\"\u003e\u003c/a\u003e\n\u003ca href=\"https://codecov.io/gh/robiningelbrecht/phpunit-pretty-print\" \u003e\u003cimg src=\"https://codecov.io/gh/robiningelbrecht/phpunit-pretty-print/branch/master/graph/badge.svg?token=nswXQDBEl5\"/\u003e\u003c/a\u003e\n\u003ca href=\"https://phpstan.org/\"\u003e\u003cimg src=\"https://img.shields.io/badge/PHPStan-level%209-succes.svg?logo=php\u0026logoColor=white\u0026color=31C652\" alt=\"PHPStan Enabled\"\u003e\u003c/a\u003e\n\u003ca href=\"https://php.net/\"\u003e\u003cimg src=\"https://img.shields.io/packagist/php-v/robiningelbrecht/phpunit-pretty-print?color=%23777bb3\u0026logo=php\u0026logoColor=white\" alt=\"PHP\"\u003e\u003c/a\u003e\n\u003ca href=\"https://phpunit.de/\"\u003e\u003cimg src=\"https://img.shields.io/packagist/dependency-v/robiningelbrecht/phpunit-pretty-print/phpunit/phpunit.svg?logo=php\u0026logoColor=white\" alt=\"PHPUnit\"\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/robiningelbrecht/phpunit-pretty-print\"\u003e\u003cimg src=\"https://img.shields.io/packagist/v/robiningelbrecht/phpunit-pretty-print?logo=packagist\u0026logoColor=white\" alt=\"PHPUnit\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n---\n\nI really like how [Pest PHP](https://pestphp.com/) formats and outputs test results, \nbut I still prefer to use [PHPUnit](https://phpunit.de/). Luckily there's [Collision](https://github.com/nunomaduro/collision).\nThis package is designed to give you beautiful error reporting when interacting with your app through the command line.\n\n## Installation\n\n```bash\ncomposer require robiningelbrecht/phpunit-pretty-print --dev\n```\n\n## Configuration\n\nNavigate to your `phpunit.xml.dist` file and add following config to set default options \n(you can also set these options at run time):\n\n```xml\n\u003cextensions\u003e\n    \u003cbootstrap class=\"RobinIngelbrecht\\PHPUnitPrettyPrint\\PhpUnitExtension\"\u003e\n    \u003c/bootstrap\u003e\n\u003c/extensions\u003e\n```\n\nAlso make sure the `color` attribute is set to `true`:\n\n```xml\n\u003cphpunit \n        colors=\"true\"\u003e\n\u003c/phpunit\u003e\n```\n\n## Options\n\nAll these options can be set at runtime as well, see \u003ca href=\"#usage\"\u003eusage\u003c/a\u003e.\n\n### Output profiling report\n\n```xml\n\u003cextensions\u003e\n    \u003cbootstrap class=\"RobinIngelbrecht\\PHPUnitPrettyPrint\\PhpUnitExtension\"\u003e\n        \u003cparameter name=\"displayProfiling\" value=\"true\"/\u003e\n    \u003c/bootstrap\u003e\n\u003c/extensions\u003e\n```\n\n### Enable compact mode\n\n```xml\n\u003cextensions\u003e\n    \u003cbootstrap class=\"RobinIngelbrecht\\PHPUnitPrettyPrint\\PhpUnitExtension\"\u003e\n        \u003cparameter name=\"useCompactMode\" value=\"true\"/\u003e\n    \u003c/bootstrap\u003e\n\u003c/extensions\u003e\n```\n\n### Feel good about yourself after running your testsuite by displaying a Chuck Noris quote\n\n```xml\n\u003cextensions\u003e\n    \u003cbootstrap class=\"RobinIngelbrecht\\PHPUnitPrettyPrint\\PhpUnitExtension\"\u003e\n        \u003cparameter name=\"displayQuote\" value=\"true\"/\u003e\n    \u003c/bootstrap\u003e\n\u003c/extensions\u003e\n```\n\n### Disable pretty print. \n\nThis can be useful when you only want to prettify the output when forced via CLI (see \u003ca href=\"#usage\"\u003eusage\u003c/a\u003e).\n\n```xml\n\u003cextensions\u003e\n    \u003cbootstrap class=\"RobinIngelbrecht\\PHPUnitPrettyPrint\\PhpUnitExtension\"\u003e\n        \u003cparameter name=\"enableByDefault\" value=\"false\"/\u003e\n    \u003c/bootstrap\u003e\n\u003c/extensions\u003e\n```\n\n## Usage\n\n```bash\n\u003e vendor/bin/phpunit\n```\n\n\u003cp align=\"center\"\u003e\n\t\u003cimg src=\"readme/example-default.png\" alt=\"Example default\"\u003e\n\u003c/p\u003e\n\n### Output profiling report\n\n```bash\n\u003e vendor/bin/phpunit -d --profiling\n```\n\n\u003cp align=\"center\"\u003e\n\t\u003cimg src=\"readme/example-profiling.png\" alt=\"Example profiling\"\u003e\n\u003c/p\u003e\n\n### Enable compact mode\n\n```bash\n\u003e vendor/bin/phpunit -d --compact\n```\n\n\u003cp align=\"center\"\u003e\n\t\u003cimg src=\"readme/example-compact.png\" alt=\"Example compact\"\u003e\n\u003c/p\u003e\n\n### Display Chuck Norris quote\n\n```bash\n\u003e vendor/bin/phpunit -d --display-quote\n```\n\n\u003cp align=\"center\"\u003e\n\t\u003cimg src=\"readme/example-quote.png\" alt=\"Example quote\"\u003e\n\u003c/p\u003e\n\n### Enable/disable pretty print\n\n```bash\n\u003e vendor/bin/phpunit -d --enable-pretty-print\n\u003e vendor/bin/phpunit -d --disable-pretty-print\n```\n\n### Combine multiple options\n\n```bash\n\u003e vendor/bin/phpunit --configuration=tests/phpunit.test.xml -d --compact -d --display-quote\n```\n\n## PHPUnit 9.x\n\nThis package does not support PHPUnit 9.x but Collision does out of the box. Run \n\n```bash\ncomposer require nunomaduro/collision:^6.0\n```\n\nThen add the Collision `printerClass` to your `phpunit.xml` in the `phpunit` section:\n\n```xml\n\u003cphpunit\n        printerClass=\"NunoMaduro\\Collision\\Adapters\\Phpunit\\Printer\"\u003e\n```\n        \n## Acknowledgements\n\n* API used for Chuck Noris quotes: https://api.chucknorris.io/\n* CLI formatting: https://github.com/nunomaduro/collision\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobiningelbrecht%2Fphpunit-pretty-print","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frobiningelbrecht%2Fphpunit-pretty-print","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobiningelbrecht%2Fphpunit-pretty-print/lists"}