summaryrefslogtreecommitdiff
path: root/_test/README
diff options
context:
space:
mode:
Diffstat (limited to '_test/README')
-rw-r--r--_test/README154
1 files changed, 70 insertions, 84 deletions
diff --git a/_test/README b/_test/README
index 099290a0d..654b99182 100644
--- a/_test/README
+++ b/_test/README
@@ -1,84 +1,70 @@
---------------------------------------------------------------------------------
- Dokuwiki Unit Test Suite
---------------------------------------------------------------------------------
-$Date: 2004/02/14 02:14:50 $
-
-Credits: to the WACT team - http://www.phpwact.org, from whom the basis of
-this test suite was stolen
-
---------------------------------------------------------------------------------
-INSTALLING & SETUP
-
-1. Grab a copy of the SimpleTest unit testing framework an extract somewhere
-
- http://www.lastcraft.com/simple_test.php
- or
- http://sourceforge.net/projects/simpletest
-
-2. Edit ./tests.ini
-
- - TEST_ENABLED - set to "1" to allow the test suite to be used
- by vistors to your site. Generally best to leave as 0 for
- a productive site - running tests alot will hammer the server
- Note: you will still be able to run the tests from the command
- line even when this is set to 0
-
- - WEB_TEST_URL - this is for running "web tests" where SimpleTest
- acts as a web browser and executes HTTP requests against pages.
- Should point at your Dokuwiki URL e.g.
-
- http://localhost/dokuwiki
-
- - PROXY - if you're behind a proxy, specify it here
- Note: username / password are optional e.g.
-
- http://proxyuser:proxypwd@proxy.yourdomain.com:8080
-
- - REMOTE_TEST_URL - it's possible to run the full test suite
- remotely (over HTTP) with some XML goodness. This should
- point at the URL of the test suite you want to test
- See the following URL for more info;
- http://www.sitepoint.com/blogs/2004/06/15/simple-test-remote-testing/
-
- - Simple Test
- Update the library_path to point at the directory where you installed
- Simple Test
-
---------------------------------------------------------------------------------
-RUNNING THE TESTS
-
-You can run the tests in three ways. From the command line:
-
- $ ./runtests.php -h
-
-Using a web browser;
-
- http://localhost/dokuwiki/_test/index.php
-
-As remote tests run on a remote serveri (specified in tests.ini with REMOTE_TEST_URL) and driven locally from the command line using;
-
- $ ./remotetests.php -h
-
-
---------------------------------------------------------------------------------
-ADDING TESTS
-
-The test cases are kept in the './cases' directory in a directory structure
-mirroring that of the Dokuwiki's
-
-Files with the extension .group.php are group tests (collections of
-one or more seperate unit test files) - there should be one group
-test per file in Dokuwiki's real directory.
-
-Individual tests files have the extension .test.php
-
-To add tests, create a .test.php file in the correct directory under ./cases
-Probably best to use one of the existing scripts as a basis
-
-The test will not be executable via one of the test runners (see above).
-
-To add it to a group of tests, modify the corresponding .group.php file.
-
-One exception to the naming convention - files named .webtest.php and
-.webgroup.php are run using SimpleTest's browser simulator.
-
+DokuWiki Test Suite
+=============================================================================
+
+Content of this document:
+
+ * Requirements
+ * Installation of PHPUnit via Pear
+ * Running all Tests
+ * Create new Tests
+ * TODO for test framework
+ * Migration Protocol
+
+
+
+Requirements
+-----------------------------------------------------------------------------
+
+ * PHP Unit 3.7
+
+
+Installation of PHPUnit via Pear
+-----------------------------------------------------------------------------
+
+ > pear config-set auto_discover 1
+ > pear upgrade
+ > pear install pear.phpunit.de/PHPUnit
+
+
+Running all Tests
+-----------------------------------------------------------------------------
+
+ > cd _testing/
+ > phpunit
+
+PHPUnit will fail on some systems with the error 'headers already sent'. The
+known workaround for that is to use the '--stderr' flag for PHPUnit:
+
+ > phpunit --stderr
+
+
+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 http://www.dokuwiki.org/devel:unittesting
+ * optional: add helper methods to TestRequest for easy form submission
+ * createForm(), ...
+
+
+Migration Protocol
+-----------------------------------------------------------------------------
+
+The following tests were not migrated:
+
+ * inc/html_hilight (runkit)
+ * inc/indexer_idx_indexlengths (fs dependencies)
+ * inc/mail_send (integration test)
+ * inc/parser/parser_formatting
+ * inc/parser/xhtml_htmlphp (runkit)
+ * inc/parser/xhtml_links
+