Download the PHP package avvertix/wptesttool without Composer

On this page you can find all versions of the php package avvertix/wptesttool. 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 wptesttool

Build Status

Wordpress UnitTest tools

This project serves as command line to enable the download of the Wordpress Unittests helper functions and setup the environment for executing your plugin Unit Tests

This suite is heavily inspired by the WordPress REST API plugin install-wp-test.sh shell script. That script was a great source to learn how to unittest Wordpress plugins.

Compatible with Wordpress 4.4.2

What?

This toolset, available also in a phar version, downloads the Wordpress release, the Unit Tests includes and assist you during the execution configuration of the tests

Usage

step 1

In order to configure the required dependencies neeeded to execute a Wordpress based unit test execute:

Available parameters

parameter purpose
wp-version The Wordpress version to use for the tests (e.g. 4.4.2). Default value if not specified is latest therefore the latest release will be used

Available options

option default value purpose
db wptest The test database name
user wptest The test database username
pass wptest The test database password
host localhost The test database host

step 2

Now you can create a stub of the phpunit.xml file and the bootstrap to be loaded when running the unit tests.

To create the stub files launch

parameter purpose
test-folder The folder where you will place the unit-tests. Default tests
option description
plugin You can specify the file that will be readed by Wordpress to load the plugin

The boostrap will enable the usage of an environment variable called PLUGIN_FILE you can use to specify the main file that will load the plugin in Wordpress.

Full Commands List

downloadwp Command

Download a Wordpress version and extracts into ./tmp/wordpress/

parameter purpose
wp-version The Wordpress version to use for the tests (e.g. 4.4.2). Default value if not specified is latest therefore the latest release will be used

installwp Command

Download the Wordpress unit test inclusions and the example wp-config to be used when running the tests. The folder used is ./tmp/

parameter purpose
wp-version The Wordpress version to use for the tests (e.g. 4.4.2). Default value if not specified is latest therefore the latest release will be used

stub Command

Creates the phpunit.xml and a boostrap.php file that define the uni tests configuration and the loader of the dependencies for running the tests.

parameter purpose
test-folder The folder where you will place the unit-tests. Default tests
option description
plugin You can specify the file that will be readed by Wordpress to load the plugin
phpunit You can specify the PHPUnit configuration file name (default phpunit.xml)

the phpunit.xml file will be created in the current directory from which the wptesttools binary is executed, while the boostrap.php will be created in the test-folder.

calling multiple times the stub command will overwrite existing files


All versions of wptesttool with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6.5
seld/jsonlint Version ~1.5.0
symfony/console Version ~2.8.0
symfony/finder Version ~2.8.0
guzzlehttp/guzzle Version ^6.2.0
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 avvertix/wptesttool contains the following files

Loading the files please wait ....