Download the PHP package 10up/wp-codeception without Composer

On this page you can find all versions of the php package 10up/wp-codeception. 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-codeception

WP Codeception

This is a WordPress Plugin which integrates with the Codeception PHP testing framework and allows you to write and run Codeception tests for WordPress via WP CLI.

We're working towards supporting all of Codeceptions commands. If you find one we haven't included yet, please submit a Pull Request!

Installation

Download the latest version and extract, or clone the repository with Git into a new directory wp-content/plugins/wp-codeception in your WordPress install.

Install required node modules and composer dependencies

We'll run our commands from within VVV because WP CLI, Node, and Composer are already installed for us there.

Afterwards you'll have a new vendor directory within your plugins/wp-codeception directory which contains all the code libraries we're dependant on.

Install as a composer dependency

There is an alternative way to install this plugin. You can add it as a composer dependency for your project. To do it, run following command in your terminal:

This command will install the plugin and all its dependencies for your project. Please, pay attention that if you already use composer/installers dependency in your project, then wp-codeception will be installed into <PROJECT_DIR>/wp-content/plugins/wp-codeception/ folder. It happens, because wp-codeception has wordpress-plugin type and will be processed by composer/installers accordingly (read its documentation for more details).

If you want to add it as a dependency to your plugin or theme, you will need to update your composer.json file and tell it where to install wp-codeception. You can achieve it by providing installer-paths instructions like in the snippet below.

Now composer/installers will know to install wordpress plugins into vendor folder. The final step which you need to do is to update your autoload section and add wp-codeception.php file to the autoload files list.

Install the test suite

See the Codeception bootstrapping documentation for further information.

Afterwards you'll have a new tests directory within your plugin or theme directory. This is your new test suite, and where you'll write all your tests.

Writing Tests

You can write tests using any of the three Codeception testing frameworks: Acceptance, Functional and Unit testing. If you look within the new tests directory you'll see three config files; one for each test framework (acceptance.suite.yml, functional.suite.yml, unit.suite.yml). Edit these files as you wish.

Generate your first test

Afterwards you'll have a new file in your plugin or theme directory tests/acceptance/LoginTest.php, where you can write your first test. Remember, any Codeception test will work here! For example, you could run any of the acceptance test examples mentioned in the Codeception documentation. Likewise, the same goes for Functional and Unit tests.

Example: Writing a Login Acceptance Test

Running Your Tests

Now you've written some tests, it's time to run them! But first..

Selenium

If you've created any browser automation/acceptance tests you'll need to turn Selenium on, and likewise, you'll want to stop Selenium after you're through running tests.

Run

You'll use the run command to execute your tests from within your plugin or theme directory (where you ran the bootstrap). We've implemented most of the Codeception 'run' command arguments, but if you find one we've missed please submit a Pull Request!

Example: Running our Login Test

Support Level

Archived: This project is no longer maintained by 10up. We are no longer responding to Issues or Pull Requests unless they relate to security concerns. We encourage interested developers to fork this project and make it their own!

Like what you see?


All versions of wp-codeception with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
codeception/codeception Version 2.0.11
fzaninotto/faker Version 1.5.*@dev
composer/installers Version ^1.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 10up/wp-codeception contains the following files

Loading the files please wait ....