{"id":16362973,"url":"https://github.com/dpi/enhanced-drupal-phpunit-results","last_synced_at":"2025-03-21T00:31:50.047Z","repository":{"id":37010655,"uuid":"504070334","full_name":"dpi/enhanced-drupal-phpunit-results","owner":"dpi","description":"Provides an enhanced PHPUnit result printer for Drupal.","archived":false,"fork":false,"pushed_at":"2024-06-20T01:17:22.000Z","size":967,"stargazers_count":1,"open_issues_count":5,"forks_count":1,"subscribers_count":2,"default_branch":"1.x","last_synced_at":"2025-03-17T17:01:49.095Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/dpi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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}},"created_at":"2022-06-16T08:15:44.000Z","updated_at":"2023-11-13T13:03:36.000Z","dependencies_parsed_at":"2024-10-28T09:12:04.858Z","dependency_job_id":"0b10c267-ea50-4f7c-85d1-bda44899a598","html_url":"https://github.com/dpi/enhanced-drupal-phpunit-results","commit_stats":{"total_commits":11,"total_committers":2,"mean_commits":5.5,"dds":0.09090909090909094,"last_synced_commit":"82fcf49012b5b316538645cdc275253e171cd398"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dpi%2Fenhanced-drupal-phpunit-results","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dpi%2Fenhanced-drupal-phpunit-results/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dpi%2Fenhanced-drupal-phpunit-results/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dpi%2Fenhanced-drupal-phpunit-results/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dpi","download_url":"https://codeload.github.com/dpi/enhanced-drupal-phpunit-results/tar.gz/refs/heads/1.x","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244094266,"owners_count":20397020,"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":[],"created_at":"2024-10-11T02:26:03.702Z","updated_at":"2025-03-21T00:31:47.767Z","avatar_url":"https://github.com/dpi.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Enhanced Drupal PHPUnit Results\n\n[![Codecov](https://img.shields.io/codecov/c/github/dpi/enhanced-drupal-phpunit-results)][code-coverage]\n[![GitHub branch checks state](https://img.shields.io/github/checks-status/dpi/enhanced-drupal-phpunit-results/1.x)][ci]\n[![License](http://poser.pugx.org/dpi/enhanced-drupal-phpunit-results/license)](https://packagist.org/packages/dpi/enhanced-drupal-phpunit-results)\n\nProvides tooling to improve the output of PHPUnit tests with Drupal.\n\n**After**\n\n![Spotlight After](docs/after.png)\n\n**Before**\n\n![Spotlight Before](docs/before.png)\n\n**Highlights**\n\n - Command-click/control click URL to open artifact in web browser.\n - Command-click/control click file+line to open in IDE (PHPStorm / VSCode / MacVim / Emacs / Sublime Text / Textmate)\n - The URL fetched is shown.\n - `drupalGet`/`drupalLogin`/`drupalLogout`/`htmlOutput`/`submitForm` page loads are detected,\n - Icon shown indicating whether artifact is associated with a page load: 📄 `drupalGet` 🛂 `drupalLogin` 🥾 `drupalLogout` ⚡️ `htmlOutput` 🖍 `submitForm`\n - Test method is green or red depending on test pass/failure.\n - Execution stack is shown between the test method and the point of page load.\n - For direct invocations of page load from a test, a short stack is shown.\n\nThe project is intended for use with functional tests, specifically projects\nutilizing [Drupal Test Traits][dtt]. Its recommended to utilize\n`phpunit --printer` or create a new `phpunit.xml` to separate Kernel and\nUnit tests.\n\nTests will need to use the included trait. Out of the box this enhancement\ncannot be used with tests out of your control, unless base test classes are\npatched, such as `\\Drupal\\Tests\\BrowserTestBase`.\n\n_Drupal is a registered trademark of Dries Buytaert._\n\n## Installation and setup\n\n```shell\ncomposer require dpi/enhanced-drupal-phpunit-results\n```\n\nIn PHPUnit configuration files such as `phpunit.xml`, `phpunit.xml.dist`, etc,\nmodify printerClass to reference the class from this library:\n\n```xml\n\u003cphpunit printerClass=\"\\dpi\\EnhancedDrupalPhpunitResults\\EnhancedResultPrinter\" /\u003e\n```\n\nIn base test files, replace `use \\Drupal\\Tests\\UiHelperTrait` with\n`use \\dpi\\EnhancedDrupalPhpunitResults\\CombinedEnhancedUiHelperTrait`.\n\nOr if there are collisions,\n\n```php\nuse EnhancedUiHelperTrait {\n    EnhancedUiHelperTrait::htmlOutput insteadof UiHelperTrait;\n}\n```\n\n## Configuration\n\nOptional configuration is available.\n\nSet these values as environment variables in the executor or phpunit.ini file.\n\n### IDE launch links\n\nWill trigger control/command-clicks on file paths to open in an editor of choice.\n\nPossible values:\n\n - `emacs`\n - `macvim`\n - `phpstorm`\n - `sublime`\n - `textmate`\n - `vscode`\n\n`export ENHANCED_RESULTS_IDE=phpstorm`\n\n```xml\n\u003cphp\u003e\n    \u003cenv name=\"ENHANCED_RESULTS_IDE\" value=\"phpstorm\" /\u003e\n\u003c/php\u003e\n```\n\n![IDE Launch Links](docs/ide.png)\n\n### Repeat context\n\nWill repeat the executing test at the top of the stack. Normally the executed\ntest is only printed once at the beginning. This option will\nprint the test in context for each drupalGet at the top of the stack. This is\nuseful for tests with many drupalGets.\n\n`export ENHANCED_RESULTS_USE_REPEAT_CONTEXT=TRUE`\n\n```xml\n\u003cphp\u003e\n    \u003cenv name=\"ENHANCED_RESULTS_USE_REPEAT_CONTEXT\" value=\"TRUE\" /\u003e\n\u003c/php\u003e\n```\n\n![IDE Launch Links](docs/repeatcontext.png)\n\n### Disable trimming columns to terminal width\n\nDisable trimming file and URL text strings to terminal width. Instead strings\nwill display untruncated.\n\n`export ENHANCED_RESULTS_DISABLE_TRIM_COLUMNS=TRUE`\n\n```xml\n\u003cphp\u003e\n    \u003cenv name=\"ENHANCED_RESULTS_DISABLE_TRIM_COLUMNS\" value=\"TRUE\" /\u003e\n\u003c/php\u003e\n```\n\n### Disable stacks\n\nDisable long stacks if they are noisy\n\n`export ENHANCED_RESULTS_DISABLE_OUTPUT_STACK=TRUE`\n\n```xml\n\u003cphp\u003e\n    \u003cenv name=\"ENHANCED_RESULTS_DISABLE_OUTPUT_STACK\" value=\"TRUE\" /\u003e\n\u003c/php\u003e\n```\n\n![IDE Launch Links](docs/notruncation.png)\n\n### Use sequential IDS instead of artifact numbers\n\nDisplay numbers next to each drupalGet, starting from 1, relative to the current\ntest run. Instead of artifact numbers.\n\n`export ENHANCED_RESULTS_USE_SEQUENTIAL_IDS=TRUE`\n\n```xml\n\u003cphp\u003e\n    \u003cenv name=\"ENHANCED_RESULTS_USE_SEQUENTIAL_IDS\" value=\"TRUE\" /\u003e\n\u003c/php\u003e\n```\n\n### Change file prefix\n\nChanges file prefix so clickable files work, useful when used with Docker\nmounts or symlinks.\n\n`export ENHANCED_RESULTS_FILE_PREFIX=/home/user/www`\n\n```xml\n\u003cphp\u003e\n    \u003cenv name=\"ENHANCED_RESULTS_FILE_PREFIX\" value=\"/home/user/www\" /\u003e\n\u003c/php\u003e\n```\n\n# Other notes\n\n - Utilize Drupal's builtin `BROWSERTEST_OUTPUT_BASE_URL` if artifacts are\n   accessed by a different URL by the host OS, than the test runner. This helps\n   to resolve issues with incorrect clickable artifact URLs.\n\n\n[ci]: https://github.com/dpi/enhanced-drupal-phpunit-results/actions\n[code-coverage]: https://app.codecov.io/gh/dpi/enhanced-drupal-phpunit-results\n[dtt]: https://gitlab.com/weitzman/drupal-test-traits\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdpi%2Fenhanced-drupal-phpunit-results","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdpi%2Fenhanced-drupal-phpunit-results","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdpi%2Fenhanced-drupal-phpunit-results/lists"}