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

Jan Schneider jan at horde.org
Tue Oct 3 14:49:00 UTC 2017


jan  Tue, 03 Oct 2017 14:49:00 +0000

Modified page: https://wiki.horde.org/Doc/Dev/Test
New Revision:  8
Change log:  Update directory layout

@@ -6,9 +6,9 @@

  The following tree shows a hypothetical arrangement of all element  
types that you might find in a Horde package:

  <code>
-horde/framework/Xyz/
+Xyz/
  `-- test
      `-- Horde
          `-- Xyz
              |-- AllTests.php
@@ -32,11 +32,11 @@
  </code>

  We will go through the different elements below but lets first look  
at the hierarchy from the top level directory to the level of the  
{{``AllTests``.php}} file.

-The top level directory {{horde}} represents the  
[http://git.horde.org horde-git repository] that everyone should be  
familiar with.
+The top level directory {{Xyz}} represents a  
[https://https://github.com/horde horde git repository].

-The majority of the test suites can be found in the {{framework}}  
area but several applications have their own test suites as well.  
Whether a framework package or an application: In both cases the  
{{test}} directory in the top-level directory of the component will  
contain the tests.
+The majority of the test suites can be found in the framework  
libraries but several applications have their own test suites as well.  
Whether a framework package or an application: In both cases the  
{{test}} directory in the top-level directory of the component will  
contain the tests.

  Below the {{test}} directory the code hierarchy of the component  
will usually be mirrored.

  For a hypothetical framework package with name {{Horde_Xyz}} this  
means that where will be a directory {{Horde}} with a subdirectory  
{{Xyz}}. The latter one contains the tests. This matches the hierarchy  
in the {{lib}} directory where you will also find a {{Horde}}  
directory that usually contains a {{Xyz}} subdirectory. If not there  
will at least be an {{Xyz.php}} file.
@@ -46,17 +46,17 @@
  This directory structure below {{test}} is just a convention and no  
functional requirement for the tests. At least at the moment. At some  
point the idea was that you would be able to unpack all PEAR package  
archives into one location without the file paths in the components  
conflicting with each other. But when we rely on PEAR for the  
installation now then the different test suites of package  
{{Horde_One}} and {{Horde_Two}} end up in {{tests/Horde_One}} and  
{{tests/Horde_Two}} respectively. So there is no chance for a conflict  
anyway. This might change at some point though. So we stick to the  
convention and ask anyone writing new test suites to do it as well.

  +++ ``AllTests``.php

-This file is a **mandatory** requirement for a Horde test suite.  In  
almost every case you should use the boilerplate template found at  
{{framework/Test/doc/Horde/Test/template/packagetest/``AllTests``.php}}.
+This file is a **mandatory** requirement for a Horde test suite.  In  
almost every case you should use the boilerplate template found at  
{{Test/doc/Horde/Test/template/packagetest/``AllTests``.php}}.

  +++ bootstrap.php

-This file is a **mandatory** requirement for a Horde test suite.  In  
almost every case you should use the boilerplate template found at  
{{framework/Test/doc/Horde/Test/template/packagetest/bootstrap.php}}.   
This file contains the code necessary to integrate the tests with the  
rest of the Horde suite (i.e. it sets up autoloading).
+This file is a **mandatory** requirement for a Horde test suite.  In  
almost every case you should use the boilerplate template found at  
{{Test/doc/Horde/Test/template/packagetest/bootstrap.php}}.  This file  
contains the code necessary to integrate the tests with the rest of  
the Horde suite (i.e. it sets up autoloading).

  +++ phpunit.xml

-This file is a **mandatory** requirement for a Horde test suite.  In  
almost every case you should use the boilerplate template found at  
{{framework/Test/doc/Horde/Test/template/packagetest/phpunit.xml}}.
+This file is a **mandatory** requirement for a Horde test suite.  In  
almost every case you should use the boilerplate template found at  
{{Test/doc/Horde/Test/template/packagetest/phpunit.xml}}.

  +++ Autoload.php

  This file is not required . It's purpose is to setup additional PHP  
autoloading so that all tests in the test suite automatically have  
access to all the classes required for executing the tests. The  
default {{Horde_Test_AllTests}} already loads a basic autoloading  
definition that works for most framework components; this file should  
only be used if additinal autoloading is needed.



More information about the commits mailing list