xref: /dokuwiki/_test/README (revision e37739ccaac4a28aa2176487a637cbdf3d1b85a0)
1====== DokuWiki Test Suite ======
2
3This is the test suit to automatically test various parts of DokuWiki.
4
5===== Requirements =====
6
7  * PHPUnit 3.6.10+ http://www.phpunit.de/
8  * PHP 5.3+ http://www.php.net
9
10===== PHPUnit Installation ======
11
12via PEAR:
13
14  pear config-set auto_discover 1
15  pear upgrade
16  pear install pear.phpunit.de/PHPUnit
17
18on Windows:
19
20  FIXME
21
22
23===== Running all Tests =====
24
25Just change to the ''_test'' directory and run phpunit:
26
27  cd _testing/
28  phpunit
29
30PHPUnit will fail on some systems with a //headers already sent// error.
31This is a known problem with PHPUnit, the error can be avoided by passing the
32'--stderr' flag to phpunit:
33
34  phpunit --stderr
35
36===== Running selected Tests =====
37
38You can run a single test file by providing it as an argument to phpunit:
39
40  phpunit --stderr tests/inc/common_cleanText.test.php
41
42FIXME add info about test groups.
43
44===== Create new Tests =====
45
46To create a test for DokuWiki, create a *.test.php file within the tests/
47folder. Please respect the folder structure and naming convention. Inside the
48file, implement a class, extending 'DokuWikiTest'. Every method, starting
49with 'test' will be called as a test (e.g. 'testIfThisIsValid');
50
51
52===== TODO for the test framework =====
53
54  * test cross platform compatibility: especially test windows
55  * update http://www.dokuwiki.org/devel:unittesting
56  * optional: add helper methods to TestRequest for easy form submission
57    * createForm(), ...
58  * check PHP Unit test_helpers https://github.com/sebastianbergmann/php-test-helpers
59
60
61===== Migration Protocol =====
62
63The following tests were not migrated:
64
65  * inc/indexer_idx_indexlengths (fs dependencies)
66  * inc/mail_send (integration test)
67  * inc/parser/parser_formatting
68  * inc/parser/xhtml_htmlphp (runkit)
69  * inc/parser/xhtml_links
70
71