Repository navigation
Code contributions
Code contributions
In order to make any code contributions, you will need to install Git on your computer.
Any WAMP/MAMP/LAMP local environment with a WordPress installation will be suited for local development.
Warning: For running tests, you need a dedicated test database. This is important to separate it from your production databases because the tests will drop the complete database each time they are run!
You also will need a local copy of the WordPress/wordpress-develop repository.
# Through HTTPS
git clone https://github.com/WordPress/wordpress-develop.git
# or
# Through SSH
git clone git@github.com:WordPress/wordpress-develop.gitYou will then need to add a WP_TESTS_DIR environment variable that points to the WordPress tests library.
For Unix operating systems:
In your ~/.profile file, add the following line:
export WP_TESTS_DIR="$HOME/path/to/wordpress-develop/tests/phpunit"Then in wordpress-develop, copy the wp-tests-config-sample.php into a wp-tests-config.php file.
Change the following lines to match your test database:
define( 'DB_NAME', 'my-dedicated-test-database' );
define( 'DB_USER', 'user' );
define( 'DB_PASSWORD', 'password' );
define( 'DB_HOST', 'localhost' );You also need a local installation of Composer. This will let you install the development dependencies, including PHPUnit.
composer installAnd you can run the tests from the PHPUnit package:
vendor/bin/phpunitThe wp-env package was developed with the Gutenberg project as a quick way to create a standard WordPress environment using Docker. It is also published as the @wordpress/env npm package.
You can use it for contributing to the WP Notify project, but you need to install it on your computer first. read the prerequisites and the install as a global package from its manual.
An npm script is provided in order to start the PHP unit tests:
npm run test-unit-php