4 Whether you want to fix a bug or implement a new feature, the process is pretty much the same:
6 0. [Search existing issues](https://github.com/wp-cli/wp-cli/issues); if you can't find anything related to what you want to work on, open a new issue so that you can get some initial feedback.
7 1. [Fork](https://github.com/wp-cli/wp-cli/fork) the repository.
8 2. Make the code changes in your fork.
9 3. Open a pull request.
11 It doesn't matter if the code isn't perfect. The idea is to get it reviewed early and iterate on it.
13 If you're adding a new feature, please add one or more functional tests for it in the `features/` directory. See below.
15 Lastly, please follow the [WordPress Coding Standards](http://make.wordpress.org/core/handbook/coding-standards/).
17 Running and writing tests
18 -------------------------
20 There are two types of automated tests:
22 * unit tests, implemented using [PHPUnit](http://phpunit.de/)
23 * functional tests, implemented using [Behat](http://behat.org)
25 To set everything up, just run:
33 The unit test files are in the `tests/` directory.
35 To run the unit tests, just execute:
41 The functional test files are in the `features/` directory.
43 Before running the functional tests, you'll need a MySQL user called `wp_cli_test` with the
44 password `password1` that has full privileges on the MySQL database `wp_cli_test`.
45 Running the following as root in MySQL should do the trick:
47 GRANT ALL PRIVILEGES ON wp_cli_test.* TO "wp_cli_test"@"localhost" IDENTIFIED BY "password1";
49 Then, to run the entire test suite:
51 php behat.phar --expand
53 Or to test a single feature:
55 php behat.phar features/core.feature
57 More info can be found from `php behat.phar --help`.
62 Thanks! Hacking on WP-CLI should be fun. If you find any of this hard to figure
63 out, let us know so we can improve our process or documentation!