Notice: You are browsing the documentation for PrestaShop 8, which is currently in development.

You might want to read the documentation for the current version, PrestaShop 1.7.

How to execute the PrestaShop automatic test suite

Executing Unit/integration test suites

At least four test suites are available, testing different parts of PrestaShop:

  • Unit tests
  • Integrations tests
  • Functional tests
  • Legacy endpoints

Each suite needs a specific PHPUnit configuration. This is why each test suite has a specific composer command:

  • composer unit-tests
  • composer integration-tests
  • composer integration-behaviour-tests
  • composer phpunit-endpoints
You can execute the entire PHPUnit test suites using the composer test-all command.

Executing the Functional test suites

This is thoroughly explained in the Puppeteer tests Readme file.

Executing only part of phpunit tests

When implementing a new feature it is much faster to run only your specific tests. You can run only one test class with phpunit. But you must provide the phpunit.xml configuration to get the test environment bootstrapped correctly.

vendor/bin/phpunit -c tests/Unit/phpunit.xml tests/Unit/PrestaShopBundle/Command/ConfigCommandTest.php

Or even just few test methods

vendor/bin/phpunit --debug -c tests/Unit/phpunit.xml tests/Unit/PrestaShopBundle/Command/ConfigCommandTest.php --filter testSet
Hint: --debug without --filter gives a nice list to filter with.