TestingEnvironment

Michal Čihař edited this page Dec 20, 2016 · 6 revisions
Clone this wiki locally

This page will contain info on setting up a test environment.

Prerequisites.

  • PHP 5.5 (or later) but PHP 7.0 (or later) is highly recommended
  • Xdebug 2.1.0 (or later) is highly recommended
  • PHP Unit 4.1 (or later)

Installing PHPUnit

Running composer install in phpMyAdmin root will give you all needed tools. See Composer for more information about using composer.

Please refer to https://phpunit.de/manual/current/en/installation.html for PHPUnit installation instructions.

Installing Selenium

  • Download a distribution archive of Selenium Server
  • Unzip the distribution archive and copy selenium-server-standalone-2.9.0.jar (check the version suffix) to /usr/local/bin, for instance
  • Start the Selenium Server server by running java -jar /usr/local/bin/selenium-server-standalone-2.9.0.jar
    • This can be on a totally different computer, e.g. a machine that has a specific browser available.
  • All needed PHP libraries are already installed using Composer

Configuring Selenium

  • Please refer to test/README.rst.

Configuring phpMyAdmin for Selenium

  • If your browser is not natively in English, you will probably have to add this in config.inc.php:

$cfg['Lang'] = 'en';

otherwise, tests that are looking for a specific English message will fail.

Running phpMyAdmin Tests

If you successfully configured your testing environment, you can start running the phpMyAdmin Test Suite. All the tests are in the test/ folder

  • You can run test from command line specifying the configuration file.
$ cd $PHPMYADMIN_SOURCES`
$ ./vendor/bin/phpunit -c phpunit.xml.nocoverage
  • If you are also interested in the code coverage report, run this command. It will take much longer and will use quite a lot memory :
$ cd $PHPMYADMIN_SOURCES`
$ ./vendor/bin/phpunit -c phpunit.xml.dist

Currently Unit Tests under heavy development. Details can be found on the Unit_Testing page.

Testing environment