{"id":29150168,"url":"https://github.com/humanmade/plugin-tester","last_synced_at":"2025-06-30T23:09:45.922Z","repository":{"id":45669618,"uuid":"261146941","full_name":"humanmade/plugin-tester","owner":"humanmade","description":"Simple Docker image for running unit tests for WordPress plugins","archived":false,"fork":false,"pushed_at":"2025-06-03T18:55:03.000Z","size":33,"stargazers_count":21,"open_issues_count":7,"forks_count":3,"subscribers_count":22,"default_branch":"master","last_synced_at":"2025-06-30T16:14:53.600Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/humanmade.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2020-05-04T10:46:20.000Z","updated_at":"2025-06-03T18:55:04.000Z","dependencies_parsed_at":"2025-06-03T19:59:17.677Z","dependency_job_id":"8910e5a5-8f66-4134-8d6c-12aa82f437ea","html_url":"https://github.com/humanmade/plugin-tester","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/humanmade/plugin-tester","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/humanmade%2Fplugin-tester","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/humanmade%2Fplugin-tester/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/humanmade%2Fplugin-tester/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/humanmade%2Fplugin-tester/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/humanmade","download_url":"https://codeload.github.com/humanmade/plugin-tester/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/humanmade%2Fplugin-tester/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262864258,"owners_count":23376461,"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":"2025-06-30T23:09:44.643Z","updated_at":"2025-06-30T23:09:45.863Z","avatar_url":"https://github.com/humanmade.png","language":"Dockerfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# humanmade/plugin-tester\n\n[![Docker Pulls](https://img.shields.io/docker/pulls/humanmade/plugin-tester)](https://hub.docker.com/repository/docker/humanmade/plugin-tester) [![Docker Image Size (latest by date)](https://img.shields.io/docker/image-size/humanmade/plugin-tester)](https://hub.docker.com/repository/docker/humanmade/plugin-tester)\n\nSimple Docker image for running unit tests for WordPress plugins.\n\nTo run the tests for your plugin, run this in your plugin directory:\n\n```sh\ndocker run --rm -v \"$PWD:/code\" humanmade/plugin-tester\n```\n\nYou will need `phpunit/phpunit` specified as a Composer dependency of your plugin. Additional arguments can be passed to PHPUnit on the CLI directly, e.g.:\n\n```sh\ndocker run --rm -v \"$PWD:/code\" humanmade/plugin-tester --stop-on-error\n```\n\n## Configuration\n\nTo configure PHPUnit, place a `phpunit.xml.dist` in the plugin root. You can alternatively use the command line arguments for PHPUnit for simpler tests.\n\nTypically your `tests` directory in your plugin should include a `bootstrap.php` including at least the following:\n\n```php\n\u003c?php\nrequire '/wp-phpunit/includes/functions.php';\n\ntests_add_filter( 'muplugins_loaded', function () {\n\trequire dirname( __FILE__ ) . '/../your-plugin-entry-point.php';\n} );\n\nrequire '/wp-phpunit/includes/bootstrap.php';\n```\n\n## Continuous Integration with Travis\n\nFor Travis, the following minimal configuration will get your tests running:\n\n```yaml\nservices:\n  - docker\n\nbefore_script:\n  - composer install\n\nscript:\n  - docker run --rm -v \"$PWD:/code\" humanmade/plugin-tester\n```\n\nWe recommend also [caching the vendor directory](https://docs.travis-ci.com/user/caching/#arbitrary-directories):\n\n```yaml\ncache:\n  timeout: 1000\n  directories:\n    - vendor\n```\n\n\n## Code Coverage\n\nPlugin Tester includes [pcov](https://github.com/krakjoe/pcov) for test coverage, which is natively supported by PHPUnit 8+.\n\nWordPress requires PHPUnit 7, so slight adjustments need to be made to PHPUnit to fix compatibility. Plugin Tester will do this automatically for you, provided you have [pcov-clobber](https://github.com/krakjoe/pcov-clobber) installed via Composer:\n\n```sh\ncomposer require --dev pcov/clobber\n```\n\nYou can then set up coverage in your `phpunit.xml.dist`, or use the command-line flags:\n\n```sh\ndocker run --rm -v \"$PWD:/code\" humanmade/plugin-tester --coverage-text --whitelist inc/\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhumanmade%2Fplugin-tester","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhumanmade%2Fplugin-tester","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhumanmade%2Fplugin-tester/lists"}