diff --git a/README.md b/README.md index 65bc4b7..de04c67 100644 --- a/README.md +++ b/README.md @@ -1,18 +1,21 @@ # WP PHPUnit Integration -The WP PHPUnit Integration package helps you write PHPUnit tests for your WordPress packages where you prefer to have the actual implementation of WordPress functions and classes available, rather than mocking them with a library such as [Brain Monkey](https://github.com/Brain-WP/BrainMonkey). +This package helps you write PHPUnit tests for your WordPress packages where you prefer to have the actual implementation of WordPress functions and classes available, rather than mocking them with a library such as [Brain Monkey](https://github.com/Brain-WP/BrainMonkey). -Depending on your intent for your tests, it is ideal for functional or integration tests, where you can also take advantage of the database. +Depending on your intent, it is ideal for functional or integration tests, where you can also take advantage of the database. -Once you require and configure this package, it will set up a fully functional WordPress environment before the tests are run, install WordPress, symlink and activate your plugin or theme, and reset everything once the tests have finished. +Once you require and configure WP PHPUnit Integration, it will set up a fully functional WordPress environment before the tests are run (installing WordPress, symlinking and activating your plugin or theme, etc.), and reset everything once the tests have finished. -All you need is PHP. You don't need a test database service running such as MySQL or MariaDB, or to configure and start Docker containers, as this package also takes advantage of the [SQLite Database Integration](https://github.com/WordPress/sqlite-database-integration). +All you need is PHP. You don't need a database service running, such as MySQL or MariaDB, for your tests, or to configure and start Docker containers, as this package also takes advantage of the [SQLite Database Integration](https://github.com/WordPress/sqlite-database-integration). ## Setup and usage +> [!WARNING] +> This package is currently in a pre-stable release. Breaking changes may occur between versions until a stable `1.0` release is published. + ### Installation -You can require this package with Composer: +As a first step, require this package with Composer: ```shell composer require --dev syde/wp-phpunit-integration @@ -39,13 +42,13 @@ You can also specify where you want to install WordPress by adding the following } ``` -No fixed location is required, as the WP PHPUnit Integration will automatically detect the location. +No fixed location is required, as WP PHPUnit Integration will automatically try to detect the location. ### Setup You can use WP PHPUnit Integration for all your PHPUnit tests. -However, if you already have unit tests where you use Brain Monkey, we recommend creating separate PHPUnit configuration and bootstrap files for your integration tests, as these files can quickly grow complex over time and become messy. +However, if you already have unit tests where you use, for example, Brain Monkey, we recommend creating separate PHPUnit configuration and bootstrap files for your integration tests, as these files can quickly grow complex over time and become messy. The following steps describe this scenario. @@ -76,7 +79,7 @@ unset($packagePath, $vendorPath); #### PHPUnit configuration -Create a `/phpunit-integration.xml.dist` file with the following content: +Next, create a `/phpunit-integration.xml.dist` file with the following content: ```xml