FOR ARCHIVAL PURPOSES ONLY

The information in this wiki hasn't been maintained for a good while. Some of the projects described have since been deprecated.

In particular, the "Ushahidi Platform v3.x" section contains information that is often misleading. Many details about this version of Platform have changed since.

This website is an extraction of the original Ushahidi wiki into a static form. Because of that, functions like logging in, commenting or searching will not work.

For more documentation, please refer to https://docs.ushahidi.com

Skip to end of metadata
Go to start of metadata

We use PHPUnit for unit tests, and Behat and Mink for functional testing.

The PHPUnit tests don’t have full coverage but should cover most libraries and models. Controllers are not unit tested YET.

Behat tests cover anything that happens on the api end: All API calls, OAuth flow, Login/logout/registration.

The frontend is NOT tested yet, but should be. We’re still figuring out how to handle this.

When developing new features or new code:

  • Tests can be written before or after code.

  • Tests MUST exist and pass before code is merged

Running the tests

We use PHPUnit for unit tests, PHPSpec for spec tests, and Behat and Mink for functional testing.

You can install the Behat, Mink and other required packages using Composer, Just run

Composer will drop the the runtimes into bin/.

Before running Behat tests, it will be necessary to create a behat.yml file:

Then edit the behat.yml file and ensure that both base_url variables matches your installation.

To run the tests themselves 

 

Travis-CI

Unit and functional tests are run automatically by Travis-CI.
See .travis.yml for config details.

  • No labels
  1. Robbie Mackay Maybe use tags to test specific behat features?

  2. Could be a good idea.. avoids me running

    ./bin/behat --config application/tests/behat.yml posts/

    ./bin/behat --config application/tests/behat.yml api.posts.feature

    to achieve the same result.

  3. Note: don't forget to create a `behat.yml` from the `behat.template` file. Then configure it with your V3 setup. 

    cp application/tests/behat.template application/tests/behat.yml