You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Andreas Gohr ae2ec528f9
Merge pull request #3442 from gturri/fix3436
3 weeks ago
..
conf disable update check by default during tests 1 year ago
core fix PHP8 errors in tests 3 months ago
data add new log dir to test data directory 5 months ago
mock separate some test AuthPlugins to single files 1 year ago
tests Merge pull request #3442 from gturri/fix3436 3 weeks ago
README Fixed broken links to php.net and redirecting pages to php.net 5 years ago
bootstrap.php run all tests without mbstring support 11 months ago
fetchphpunit.php fix version comparison in phpunit downloader 3 months ago
mysql.conf.php.dist Replace Appveyor and Travis with Github actions 5 months ago
pgsql.conf.php.dist Replace Appveyor and Travis with Github actions 5 months ago
phpcs.xml Split out temporary code style excludes 1 year ago
phpcs_MigrationAdjustments.xml Split out temporary code style excludes 1 year ago
phpunit.xml Also allow test files ending in Test.php 3 years ago

README

====== DokuWiki Test Suite ======

This is the test suite to automatically test various parts of DokuWiki.

===== Requirements =====

* PHPUnit 3.6.10+ http://www.phpunit.de/
* PHP 5.3+ http://php.net

===== PHPUnit Installation ======

You can install phpunit through your distribution's package manager or simply
download the newest phar file into the _test directory:

cd _test/
wget https://phar.phpunit.de/phpunit.phar


===== Running all tests =====

Just change to the ''_test'' directory and run phpunit (depending on your install
method):

cd _test/
phpunit

or

cd _test/
php phpunit.phar

===== Troubleshooting =====

PHPUnit will fail on some systems with a //headers already sent// error.
This is a known problem with PHPUnit, the error can be avoided by passing the
'--stderr' flag to phpunit:

phpunit --stderr

On windows you may have to enable OpenSSL support for https tests.
Some of them point to httpclient_http.tests.php on the failure.
To enable HTTPS support copy the ''libeay32.dll'' and ''ssleay32.dll''
to your ''windows\system32'' folder and add the following line to your php.ini
in the extension section:

<code ini>
extension=php_openssl.dll
</code>

===== Running selected Tests =====

You can run a single test file by providing it as an argument to phpunit:

phpunit tests/inc/common_cleanText.test.php

You can also use groups to exclude certain test from running. For example use
the following command to avoid long running test or tests accessing the
Internet.

phpunit --exclude-group slow,internet

===== Create new Tests =====

To create a test for DokuWiki, create a *.test.php file within the tests/
folder. Please respect the folder structure and naming convention. Inside the
file, implement a class, extending 'DokuWikiTest'. Every method, starting
with 'test' will be called as a test (e.g. 'testIfThisIsValid');

===== TODO for the test framework =====

* optional: add helper methods to TestRequest for easy form submission
* createForm(), ...
* check PHP Unit test_helpers https://github.com/sebastianbergmann/php-test-helpers