{"id":18106716,"url":"https://github.com/pantheon-systems/wpunit-helpers","last_synced_at":"2025-04-13T21:41:36.075Z","repository":{"id":199867340,"uuid":"704170777","full_name":"pantheon-systems/wpunit-helpers","owner":"pantheon-systems","description":"Unified scripts for installing and running automated WP Unit Tests.","archived":false,"fork":false,"pushed_at":"2025-01-06T18:07:56.000Z","size":26,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":23,"default_branch":"main","last_synced_at":"2025-03-27T12:04:01.365Z","etag":null,"topics":["hacktoberfest","phpunit","unit-testing","wordpress","wp-unit"],"latest_commit_sha":null,"homepage":"","language":"Shell","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/pantheon-systems.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2023-10-12T17:24:59.000Z","updated_at":"2025-01-06T18:07:45.000Z","dependencies_parsed_at":"2024-02-12T23:43:09.722Z","dependency_job_id":null,"html_url":"https://github.com/pantheon-systems/wpunit-helpers","commit_stats":null,"previous_names":["pantheon-systems/wpunit-helpers"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pantheon-systems%2Fwpunit-helpers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pantheon-systems%2Fwpunit-helpers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pantheon-systems%2Fwpunit-helpers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pantheon-systems%2Fwpunit-helpers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pantheon-systems","download_url":"https://codeload.github.com/pantheon-systems/wpunit-helpers/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248788866,"owners_count":21161726,"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":["hacktoberfest","phpunit","unit-testing","wordpress","wp-unit"],"created_at":"2024-10-31T23:07:49.611Z","updated_at":"2025-04-13T21:41:36.036Z","avatar_url":"https://github.com/pantheon-systems.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WPUnit Helpers\n[![Lint](https://github.com/pantheon-systems/wpunit-helpers/actions/workflows/lint.yml/badge.svg)](https://github.com/pantheon-systems/wpunit-helpers/actions/workflows/lint.yml) [![Test](https://github.com/pantheon-systems/wpunit-helpers/actions/workflows/test.yml/badge.svg)](https://github.com/pantheon-systems/wpunit-helpers/actions/workflows/test.yml) ![GitHub](https://img.shields.io/github/license/pantheon-systems/wpunit-helpers) ![GitHub release (latest by date)](https://img.shields.io/github/v/release/pantheon-systems/wpunit-helpers) [![Unofficial Support](https://img.shields.io/badge/Pantheon-Unofficial%20Support-yellow?logo=pantheon\u0026color=FFDC28)](https://docs.pantheon.io/oss-support-levels#unofficial-support)\n\nComposer plugin providing unified scripts for installing and running automated WP Unit Tests.\n\n## What is this?\n\nThis is a set of scripts that can be used in a WordPress plugin or theme repository to run automated tests using the WP Unit Test Framework built on top of PHPUnit. The Composer plugin will install these scripts into the dependent project's `bin` directory, allowing you to add helper scripts to your `composer.json`.\n\nThis package fundamentally differs from the traditional `install-wp-tests.sh` script that's existed in the WordPress community for many years by removing some of the idiosyncracies of that workflow and replacing them with a WP-CLI-based approach.\n\n## Requirements\nBefore using these scripts, you must have the following installed:\n\n* [Composer](https://getcomposer.org/)\n* [WP-CLI](https://wp-cli.org/)\n\nAdditionally, if you intend to run the tests in a CI environment, you will need to have some modern MySQL-compatible database server available (MariaDB, MySQL, etc).\n\n## What's included?\n\n* `install-wp-tests.sh` - A standardized script for installing the WP Unit Test Framework.\n* `install-local-tests.sh` - A helper script for installing WP Unit Tests locally. See [Local Testing](#local-testing) for more information.\n* `phpunit-test.sh` - A helper script for running WP Unit Tests that is intended for use in CI.\n* `helpers.sh` - A collection of helper functions used by the other scripts.\n\n## Installation\n\nUse Composer to install this package as a development dependency:\n\n```bash\ncomposer require --dev pantheon-systems/wpunit-helpers\n```\n\nOn installation, the Composer plugin will copy the scripts into the `bin` directory of the dependent project. You can then add the scripts to your `composer.json`:\n\n```json\n{\n\t\"scripts\": {\n\t\t\"phpunit\": \"phpunit --do-not-cache-result\",\n\t\t\"test\": \"@phpunit\",\n\t\t\"test:install\": \"bin/install-local-tests.sh --skip-db=true\",\n\t\t\"test:install:withdb\": \"bin/install-local-tests.sh\"\n\t}\n}\n```\n\n## Local Testing\nThe `install-local-tests.sh` script is highly configurable to allow for a variety of local environment setups. Any parameter that could be passed into `install-wp-tests.sh` is set up as an optional flag in `install-local-tests.sh`. By default, the script with no flags will assume that a new database should be created as `root` with no password.\n\n### Flags\n\n#### `--skip-db`\nIf set and `true`, this flag will skip the database creation step. This is useful if you are using a local database that is already set up. This replaces the (now deprecated) `--no-db` flag.\n\n#### `--dbname`\nThis flag will set the name of the database to be created. The default value is `wordpress_test`.\n\n#### `--dbuser`\nThis flag will set the username of the database user to be created. The default value is `root`.\n\n#### `--dbpass`\nThis flag will set the password of the database user to be created. The default value is an empty string.\n\n#### `--dbhost`\nThis flag will set the host of the database to be created. The default value is `127.0.0.1`.\n\n#### `--wpversion`\nThis flag will set the version of WordPress to be installed. The default value is `latest`. Using `nightly` here will use the latest nightly build of WordPress.\n\n#### `--tmpdir`\nThis flag will set the temporary directory to be used for the WordPress installation. The default value is `/tmp`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpantheon-systems%2Fwpunit-helpers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpantheon-systems%2Fwpunit-helpers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpantheon-systems%2Fwpunit-helpers/lists"}