Skip to content

Building and Testing

Jason Stallings edited this page Jul 23, 2018 · 8 revisions

Testing

First you'll need to start the Docker container:

make start

Then inside the container install the dependencies:

make shell
composer install
npm install

Once the environment is set up you can run the tests:

phpunit
npm test

This will run the WordPress integration tests, the QUnit tests, check for PHP syntax errors, and check for WordPress standards violations.

Here's how you can run the individual tests:

WordPress Tests:

phpunit

QUnit:

You can open tests/qunit/index.html in any browser, or use the headless runner:

npm run test:qunit

WordPress Code Standards:

grunt phpcs

PHP Lint:

grunt phplint

Building

For building there is an included script, build.sh. Run this and you'll end up with a zip in the root called phpcompat.zip.

./build.sh

You'll also have a copy of the WordPress.org SVN repo in the build subdirectory with the latest changes copied over.

When you make changes to the readme.txt you should rebuild the readme.md for GitHub. You can do this using a Grunt command. First install the dependencies:

npm install

Then run the command:

npm run readme
Clone this wiki locally