Description
WP Test is a fantastically exhaustive set of test data to measure the integrity of your plugins and themes.
This test data comes packed with lessons learned from over four years of theme and plugin support, and baffling corner cases, to create a potent cocktail of simulated, quirky user content.
WP Test still offers the following benefits over the WordPress Unit Test data.
Transparency
Without question, the WordPress Theme Unit Test Codex data is good place to start, but it can lag in updates. And when the test data did update, there was no indication of what had changed within the data.
WP Test comes with release notes indicating what has been added, removed, or changed within the data for each release.
Contribution & Community
Contributing to the WordPress Codex is fairly straightforward, but contributing to the test data is not.
By using GitHub to host the WP Test data, anyone is free to contribute to the project in a multitude of ways.
Life
Testing can be tedious and boring, but there is no need for the test data itself to be mundane. Lorem ipsum is effective and it does simulate text flow fairly well, but it’s boring as hell.
Content should come with life and character. There are no testing benefit to this, but it does inject personality and fun into traditionally dry content. This alone is a good enough reason for it to exist in this way.
Guided Help
Not only is the WP Test data content funny, it’s smart and helpful.
Whenever possible, the test data references the WordPress Codex for best practices and function references.
These kind of integration into the test data will only increase over time and lessen the barrier to resolving the issues the test data uncovers.
Installation
WP Test can be installed one of two ways, either via the WordPress Admin or via WP-CLI.
Installation via WordPress Admin
- Download the data from the repository.
- Unzip the download on your computer.
- Launch your WordPress site.
- Navigate to
Tools > Import
in the WordPress admin. - Click on
WordPress
and install the WordPress Importer plugin, if it's not already installed, and clickActivate Plugin & Run Importer
after the installation completes. - Choose the
wptest.xml
file you extracted from the zip in Step 2 and clickUpload file and import
. - On the next screen, do not change or reassign anything about the authors and make sure you check the
Download and import file attachments
box before you clickSubmit
. - Let the import process run until complete. Do not close the browser tab / window or navigate away from page while importing. You should see an
All done. Have fun!
message when the import is complete. - Happy testing! See Usage section for more details.
Installation via WP-CLI
- Make sure you have WP-CLI installed, if it's not already installed.
- Via the command line, execute the
wptest-cli-install.sh
script. - Follow the prompts to install the WP Test data.
- Happy testing! See Usage section for more details.
Usage
Once the WP Test data is installed, using WP Test is as simple as navigating to posts, pages, assigning menus, etc. and looking for layout, overflow, alignment, and other style and structure issues.
The test data is self documenting, as much as possible, to help you fix your issues.
Contributing
The word "comprehensive" was purposely left off the project description. It's not. There will always be something new squarely scenario to test. That's where you come in.
Let us know of a test we're not covering by contacting us or by adding an issue. We'd love to incorporate it into the suite and help other developers squash the issue.
For more information on how to directly contribute to the project, please read the CONTRIBUTING.md
file.
Let’s make WordPress testing easier and resilient together!
Release Notes
What has been added, removed, or modified in each release is detailed in the releases section of the project on GitHub.
License
WP Test is licensed under the GPL.
A copy of the LICENSE
is included in the root of the project.
Credits
WP Test was created in March of 2013 by Michael Novotny and has since included a number of great contributions.
The foundation of these tests are derived from WordPress’ Theme Unit Test Codex data. And in the beauty of open source, many WP Test tests have been integrated back into the "official" WordPress Unit Test data, but not everything...and not what we consider to be the most useful test / corner cases.