[commits] [Wiki] changed: Doc/Dev/TestH5

Michael Slusarz slusarz at horde.org
Sat Jan 5 16:57:18 UTC 2013


slusarz  Sat, 05 Jan 2013 09:57:18 -0700

Modified page: http://wiki.horde.org/Doc/Dev/TestH5
New Revision:  3
Change log:  more info on running unit tests

@@ -71,9 +71,9 @@
  /** Load the basic test definition */
  require_once dirname(__FILE__) . '/TestCase.php';
  </code>

-Sometimes it makes sense to pull in the definition of test helpers  
that may be used throughout the test suite. They are usually not  
available via autoloading and need to be pulled in explicitely:
+Sometimes it makes sense to pull in the definition of test helpers  
that may be used throughout the test suite. They are usually not  
available via autoloading and need to be pulled in explicitly:

  <code type="php">
  /** Load stub definitions */
  require_once dirname(__FILE__) . '/Stub/ListQuery.php';
@@ -91,11 +91,18 @@
  The class {{IMP_Imap}} would be loaded from {{dirname(``__FILE__``)  
. '/../../lib/Imap.php'}} in the example above.

  ++ Running the test suite

-The default method for running the test suite of a Horde component is  
to run {{php ``AllTests``.php}} on the command line.
+PHPUnit must be installed on your system.  If not, install  
instructions are located at  
http://www.phpunit.de/manual/current/en/installation.html.

-You can also run individual tests by navigating to the base of the  
tests directory (the level of the directory containing  
``AllTests``.php), and running:
+From the command line, navigate to the base of an application/package  
test directory (should be located in the {{tests/}} directory at the  
base of the application - navigate to the level of the directory  
containing the ``AllTests.php`` file).
+
+To run all tests, issue the command:
+<code type="sh">
+php AllTests.php
+</code>
+
+You can also run individual tests by issuing:

  <code type="sh">
  phpunit [SubDirectory1/SubDirectory2/]UnitTest.php
  </code>



More information about the commits mailing list