Download the PHP package wp-cli/wp-cli-tests without Composer

On this page you can find all versions of the php package wp-cli/wp-cli-tests. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package wp-cli-tests

wp-cli/wp-cli-tests

WP-CLI testing framework

Testing

Quick links: Support

Using

To make use of the WP-CLI testing framework, you need to complete the following steps from within the package you want to add them to:

  1. Add the testing framework as a development requirement:

  2. Add the required test scripts to the composer.json file:

    You can of course remove the ones you don't need.

  3. Optionally add a modified process timeout to the composer.json file to make sure scripts can run until their work is completed:

    The timeout is expressed in seconds.

  4. Optionally add a behat.yml file to the package root with the following content:

    This will make sure that the automated Behat system works across all platforms. This is needed on Windows.

  5. Optionally add a phpcs.xml.dist file to the package root to enable code style and best practice checks using PHP_CodeSniffer.

    Example of a minimal custom ruleset based on the defaults set in the WP-CLI testing framework:

    All other PHPCS configuration options are, of course, available.

  6. Update your composer dependencies and regenerate your autoloader and binary folders:

You are now ready to use the testing framework from within your package.

Launching the tests

You can use the following commands to control the tests:

Controlling what to test

To send one or more arguments to one of the test tools, prepend the argument(s) with a double dash. As an example, here's how to run the functional tests for a specific feature file only:

Prepending with the double dash is needed because the arguments would otherwise be sent to Composer itself, not the tool that Composer executes.

Controlling the test environment

WordPress Version

You can run the tests against a specific version of WordPress by setting the WP_VERSION environment variable.

This variable understands any numeric version, as well as the special terms latest and trunk.

Note: This only applies to the Behat functional tests. All other tests never load WordPress.

Here's how to run your tests against the latest trunk version of WordPress:

WP-CLI Binary

You can run the tests against a specific WP-CLI binary, instead of using the one that has been built in your project's vendor/bin folder.

This can be useful to run your tests against a specific Phar version of WP_CLI.

To do this, you can set the WP_CLI_BIN_DIR environment variable to point to a folder that contains an executable wp binary. Note: the binary has to be named wp to be properly recognized.

As an example, here's how to run your tests against a specific Phar version you've downloaded.

Setting up the tests in Travis CI

Basic rules for setting up the test framework with Travis CI:

Here's a basic setup of how you can configure Travis CI to work with the test framework (extract):

WP-CLI version

You can point the tests to a specific version of WP-CLI through the WP_CLI_BIN_DIR constant:

WordPress version

If you want to run the feature tests against a specific WordPress version, you can use the WP_VERSION constant:

The WP_VERSION constant also understands the latest and trunk as valid version targets.

The database credentials

By default, the tests are run in a database named wp_cli_test with the user also named wp_cli_test with password password1. This should be set up via the composer prepare-tests command.

The following environment variables can be set to override the default database credentials.

Environment variables can be set for the whole session via the following syntax: export WP_CLI_TEST_DBNAME=custom_db.

They can also be set for a single execution by prepending them before the Behat command: WP_CLI_TEST_DBNAME=custom_db composer behat.

Contributing

We appreciate you taking the initiative to contribute to this project.

Contributing isn’t limited to just code. We encourage you to contribute in the way that best fits your abilities, by writing tutorials, giving a demo at your local meetup, helping other users with their support questions, or revising our documentation.

For a more thorough introduction, check out WP-CLI's guide to contributing. This package follows those policy and guidelines.

Reporting a bug

Think you’ve found a bug? We’d love for you to help us get it fixed.

Before you create a new issue, you should search existing issues to see if there’s an existing resolution to it, or if it’s already been fixed in a newer version.

Once you’ve done a bit of searching and discovered there isn’t an open or fixed issue for your bug, please create a new issue. Include as much detail as you can, and clear steps to reproduce if possible. For more guidance, review our bug report documentation.

Creating a pull request

Want to contribute a new feature? Please first open a new issue to discuss whether the feature is a good fit for the project.

Once you've decided to commit the time to seeing your pull request through, please follow our guidelines for creating a pull request to make sure it's a pleasant experience. See "Setting up" for details specific to working on this package locally.

Support

GitHub issues aren't for general support questions, but there are other venues you can try: https://wp-cli.org/#support


All versions of wp-cli-tests with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6
behat/behat Version ^3.7
dealerdirect/phpcodesniffer-composer-installer Version ^0.4.3 || ^0.5 || ^0.6.2 || ^0.7.1 || ^1.0.0
php-parallel-lint/php-console-highlighter Version ^1.0
php-parallel-lint/php-parallel-lint Version ^1.3.1
phpcompatibility/php-compatibility Version dev-develop
wp-cli/config-command Version ^1 || ^2
wp-cli/core-command Version ^1 || ^2
wp-cli/eval-command Version ^1 || ^2
wp-cli/wp-cli Version ^2.12
wp-coding-standards/wpcs Version ^3
yoast/phpunit-polyfills Version ^1.0.3 || ^2.0.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package wp-cli/wp-cli-tests contains the following files

Loading the files please wait ....