Skip to content

Unit tests

Tomasz Jędrzejewski edited this page Nov 27, 2016 · 1 revision

Unit tests can be launched with PHPUnit 5.x:

# phpunit -c

To install the database structure necessary to launch functional tests, configure the app/config/parameters.yml file (the template can be found in the same directory), and run the following command:

# php bin/console cantiga:install:db --env=test -d --type=mysql

Guidelines

  1. Unit tests shall be database-independent; if necessary, mock the database interaction,
  2. Unit tests shall follow the given-when-then structure and test one thing at a time,
  3. Functional tests should use the Symfony crawler.

Clone this wiki locally