-
Notifications
You must be signed in to change notification settings - Fork 38
Building and 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
You can also open WordPress and test the plugin manually by going to: http://localhost:8081
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
- Update changelog in readme.txt.
- Update upgrade notice in readme.txt.
- Bump plugin version in readme.txt.
- Bump plugin version in wpengine-phpcompat.php.
- Rebuild readme.md using
npm run readme
. - Add new files to the SVN repo by running
svn add ./ --force
in build/trunk - Commit the new files:
svn ci -m 'v1.4.6'
, replace 1.4.6 with the new version number. - Tag the new release by running the following commands in the build subdirectory:
svn cp trunk tags/1.4.6
svn ci -m "tagging version 1.4.6"