- PHP >=5.3
- wp-cli >=0.17.0
$ mkdir ~/.wp-cli
$ touch ~/.wp-cli/config.yml
$ mkdir ~/.wp-cli/commands
Then install.
$ cd ~/.wp-cli/commands
$ git clone [email protected]:megumi-wp-composer/megumi-wp-cli-yaml.git
Then edit the ~/.wp-cli/config.yml file so that it looks like following.
require:
- commands/megumi-wp-cli-yaml/cli.php
Place the composer.json like following.
{
"name": "megumi/mu-plugins",
"authors": [
{
"name": "John Smith",
"email": "[email protected]"
}
],
"require": {
"megumi/wp-cli-yaml": "*"
}
}
Place the plugin file like following,
<?php
/*
Plugin Name: mu-plugin for example.com
*/
require_once dirname( __FILE__ ) . '/vendor/autoload.php';
Then, just run composer.
$ composer install
$ git clone [email protected]:megumi-wp-composer/megumi-wp-cli-yaml.git
$ composer install
Then create or edit the ~/.wp-cli/config.yml file so that it looks like this:
require:
- /path/to/megumi-wp-cli-yaml/cli.php
Initialize the testing environment locally.
$ WP_CLI_BIN_DIR=/tmp/wp-cli-phar WP_CLI_CONFIG_PATH=/tmp/wp-cli-phar/config.yml bash bin/install-package-tests.sh
Then run the tests.
$ WP_CLI_BIN_DIR=/tmp/wp-cli-phar WP_CLI_CONFIG_PATH=/tmp/wp-cli-phar/config.yml vendor/bin/behat
See also: