Actions

Regression and unit tests: Difference between revisions

From LimeSurvey Manual

No edit summary
No edit summary
Line 4: Line 4:


{{Hint|Text=Always make sure new code follows the PSR-2 standard for PHP. Use codesniffer and messdetector to catch common bugs and style fixes in your code.}}
{{Hint|Text=Always make sure new code follows the PSR-2 standard for PHP. Use codesniffer and messdetector to catch common bugs and style fixes in your code.}}
Since LimeSurvey 2.65.6 you have the possibility to add unit tests to LimeSurvey.
In an ideal world, a regression test is added every time a new bug is discovered. In that way you make sure you never have to fix the same bug twice.
To enable unit testing, you have to issue the command
$ touch enabletesting
in the LimeSurvey root folder.
The test system uses phpunit, which you need to install first.


== PHPUnit ==
== PHPUnit ==

Revision as of 12:03, 15 June 2017

  Warning : Every time you discover a new bug, you should add a regression test to make sure it does not appear again.


  Warning : NEVER run tests on a productive system. The tests WILL modify the database.


 Hint: Always make sure new code follows the PSR-2 standard for PHP. Use codesniffer and messdetector to catch common bugs and style fixes in your code.


Since LimeSurvey 2.65.6 you have the possibility to add unit tests to LimeSurvey.

In an ideal world, a regression test is added every time a new bug is discovered. In that way you make sure you never have to fix the same bug twice.

To enable unit testing, you have to issue the command

$ touch enabletesting

in the LimeSurvey root folder.

The test system uses phpunit, which you need to install first.

PHPUnit