Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 1541e4143c

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.


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

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

===== Requirements =====

  * PHPUnit 3.6.10+
  * PHP 5.3+

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

via PEAR:

  pear config-set auto_discover 1
  pear upgrade
  pear install

on Windows:


===== Running all Tests =====

Just change to the ''_test'' directory and run phpunit:

  cd _testing/

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>

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

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

  phpunit --stderr 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

  phpunit --stderr --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 =====

  * test cross platform compatibility: especially test windows
  * update
  * optional: add helper methods to TestRequest for easy form submission
    * createForm(), ...
  * check PHP Unit test_helpers

===== Migration Protocol =====

The following tests were not migrated:

  * inc/indexer_idx_indexlengths (fs dependencies)
  * inc/mail_send (integration test)
  * inc/parser/parser_formatting
  * inc/parser/xhtml_htmlphp (runkit)
  * inc/parser/xhtml_links

Something went wrong with that request. Please try again.