3 <title>PhpWiki unit tests</title>
9 This directory contains unit tests for PhpWiki. You must have <a
10 href="http://pear.php.net/package/PHPUnit">PEAR's PHPUnit package</a>.
11 These tests are unrelated to maketest.pl in the directory above this
12 one, which do not use PHPUnit.
14 <h1>Prerequisites</h1>
17 You might want to run these from the php <a
18 href="http://us3.php.net/features.commandline">command-line
19 interface</a>. It was experimental as of PHP 4.2.0 (php-cli), default as of PHP
22 You also need the 'pear' executable to install or update the required pear libraries.
26 You can use pear to see if PHPUnit is installed:
29 /export/scratch/apache/2.0.46/php/bin) % ./pear list
33 Archive_Tar 0.9 stable
34 Console_Getopt 1.0 stable
37 HTTP_Upload 0.8.1 stable
40 Net_Socket 1.0.1 stable
43 XML_Parser 1.0.1 stable
47 If it is not installed, you can use 'pear' to install it:
50 /export/scratch/apache/2.0.46/php/bin) % ./pear install PHPUnit
53 <h1>Running these unit tests</h1>
55 You must be in the phpwiki/tests/unit subdirectory. Then use the php
56 command-line executable to run the tests. For example:
59 phpwiki/tests/unit % ./test.php
61 ran 8 tests, 0 failures.
64 Or for only some tests, give the test names on the commandline:
67 phpwiki/tests/unit % php -Cq test.php SetupWiki DumpHtml
73 Purge the testbox .. ran 4 tests, 0 failures.
76 Or run it from the browser like this:
79 http://localhost/phpwiki/test/unit/test.php?tests=SetupWiki,DumpHtml