phpBB

Development Wiki

Difference between revisions of "Running Unit Tests"

From phpBB Development Wiki

Redirect page
(Split from Unit_Tests)
 
(Redirected page to Automated Tests)
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
== Running tests on your system ==
+
#REDIRECT [[Automated_Tests]]
 
+
This is a job for your command-line/shell.
+
First, you need to install PHPUnit to your server: http://www.phpunit.de/
+
In order to install PHPUnit correctly, you need to run the following commands:
+
<pre>pear channel-update pear.php.net
+
pear install PEAR-1.9.1
+
pear channel-discover pear.phpunit.de
+
pear channel-discover components.ez.no
+
pear channel-discover pear.symfony-project.com
+
pear install --alldeps phpunit/PHPUnit</pre>
+
 
+
Once that is done:
+
You need to switch into the root directory of the git-repo.
+
And then simply run
+
Linux:<pre>phpunit</pre>
+
Windows:<pre>YOUR_DIRECTORY_WHERE_THE_FILE_IS/phpunit.bat</pre>
+
(Exp. C:/xampp/php/phpunit.bat )
+
 
+
Afterwards you should see something like:
+
<pre>PHPUnit 3.4.11 by Sebastian Bergmann.
+
 
+
............................................................  60 / 688
+
............................................................ 120 / 688
+
IIIIIIIIIII................................................. 180 / 688
+
............................................................ 240 / 688
+
............................................................ 300 / 688
+
............................................................ 360 / 688
+
............................................................ 420 / 688
+
............................................................ 480 / 688
+
............................................................ 540 / 688
+
............................................................ 600 / 688
+
............................................................ 660 / 688
+
............................
+
 
+
Time: 5 seconds, Memory: 13.00Mb
+
 
+
OK, but incomplete or skipped tests!
+
Tests: 688, Assertions: 878, Incomplete: 11.</pre>
+
If there are no errors, your test was successful. Otherwise either a test was wrong, or the functionality itself is wrong. Then you should go and fix it.
+
 
+
[[Category:Development]]
+

Latest revision as of 15:35, 21 March 2012