Permalink
Browse files

Added installation information

  • Loading branch information...
lapistano committed Oct 29, 2011
1 parent 2a5f6a4 commit 103156d6774d5a99b4619ea506a03f6a1fa36577
Showing with 77 additions and 4 deletions.
  1. +73 −0 accepted/tests/README.md
  2. +4 −4 accepted/tests/phpunit.xml.dist
View
@@ -0,0 +1,73 @@
+=============================
+PSR-0 Compatibility Testsuite
+=============================
+
+Purpose
+=======
+The PSR-0 compatibility test suite shall help you to easily and fast verify the compatability of your project
+directory and namespace structure to the PSR-0 standard[1].
+
+
+Installation
+============
+Getting the sources
+-------------------
+The installation is pretty simple just clone the sources to your favorite directory.
+This might be the test directory of your project.
+
+ $> git clone git://github.com/php-fig/fig-standards.git tests/fig-standards
+
+Due to the architecture of the test suite there is a dependency to a DirectoryScanner (see section Dependencies).
+If you already installed the *DirectoryScanner* from the *pear.netpirates.net*[2] PEAR channel you just have to
+make sure your project does find it on demand.
+Otherwise change just run *install.sh* in the *accepted/tests* directory and the test suite will take care of this.
+
+ $> /bin/sh install.sh
+
+This clones the *DirectoryScanner* from github so a functional internet connection is mandatory for tihs action.
+After you ran *install.sh* you'll find the sources in the newly created *accepted/tests/vendor* directory.
+
+Setting up
+----------
+Once the sources are on your machine, you now have to tell PHPunit to run the suite. Therefore an example
+phpunit.xml.dist file is shipped with the sources. The following list is the set of mandatory and optional settings
+to configure the DirectoryScanner. Modify them to meet the requirements of your project.
+
+* (mandatory) _Psr0_ProjectRootNamespace_
+ Root namespace of your project (e.g. Liip)..
+
+* (mandatory) _Psr0_ScannerStartDir_
+ Absolute or relative path to your source files (e.g. ../src/).
+ See https://github.com/theseer/DirectoryScanner for further information.
+
+* (optional) _Psr0_ScannerInclude_
+ Colon separated set of patterns which directories/files are to be recognized when scanning.
+ See https://github.com/theseer/DirectoryScanner for further information.
+
+* (optional) _Psr0_ScannerExclude_
+ Colon separated set of patterns which directories/files are to be ignored when scanning.
+ You usually want to exclude the directories containing the tests and 3rd party source probably located in a
+ vendor directory. This combines into the string shown in the floowing example:
+
+ */vendor/*:*/Test/*
+
+ See https://github.com/theseer/DirectoryScanner for further information.
+
+To make PHPUnit aware of the PSR-0 Compataibility Testsuite you have to add the *Psr0_CompatibilityTest.php* to the
+*<testsuite>* section of your phpunit configuration. The examle assumes that the test file is in the original location
+after a checkout described as above.
+
+ …
+ <file>../tests/fig-standards/accepted/tests/Psr0_CompatibilityTest.php</file>
+ …
+
+Dependencies
+============
+Since the PSR-0 compatibility tests depend on a static code analysis it is necessary to scan each file for its
+class and namespace name. Arne Blankerts *DirectoryScanner*[3] was the perfect library for this. Kudos to him.
+
+Links
+=====
+[1] http://groups.google.com/group/php-standards
+[2] http://pear.netpirates.net
+[3] https://github.com/theseer/DirectoryScanner
@@ -4,18 +4,18 @@
<!-- PSR-0 test configuration
- * Psr0_ProjectRootNamespace
+ * (mandatory) Psr0_ProjectRootNamespace
Root namespace of your project (e.g. Liip)..
- * Psr0_ScannerStartDir
+ * (mandatory) Psr0_ScannerStartDir
Absolute or relative path to your source files (e.g. ../src/).
See https://github.com/theseer/DirectoryScanner for further information.
- * Psr0_ScannerInclude
+ * (optional) Psr0_ScannerInclude
Colon separated set of patterns which directories/files are to be recognized when scanning.
See https://github.com/theseer/DirectoryScanner for further information.
- * Psr0_ScannerExclude
+ * (optional) Psr0_ScannerExclude
Colon separated set of patterns which directories/files are to be ignored when scanning.
You usually want to exclude the directories containing the tests and 3rd party source probably located in a
vendor directory. This combines into the string shown in the floowing example:

0 comments on commit 103156d

Please sign in to comment.