浏览代码

New: Add phpunit tests

Laurent Destailleur 15 年之前
父节点
当前提交
e921149135
共有 4 个文件被更改,包括 18 次插入31 次删除
  1. 1 1
      test/README
  2. 0 30
      test/phpunit.xml
  3. 10 0
      test/phpunittestko.xml
  4. 7 0
      test/phpunittestok.xml

+ 1 - 1
test/README

@@ -17,6 +17,6 @@ Run > phpunit TestFile.php
 If using Eclipse, select the test and click on menu "Run external tools and choose PHPUnit".
 
 * Generate a report of Unit tests code coverage:
-Run > phpunit --coverage-html ./report MyTestSuite.php
+Run > phpunit [--configuration ./phpunittestok.xml] --coverage-html ./report MyTestSuite.php
 Note that xdebug must be installed for this feature to work.
 

+ 0 - 30
test/phpunit.xml

@@ -1,30 +0,0 @@
-<phpunit backupGlobals="false"
-         backupStaticAttributes="true"
-         bootstrap="/path/to/bootstrap.php"
-         colors="false"
-         convertErrorsToExceptions="true"
-         convertNoticesToExceptions="true"
-         convertWarningsToExceptions="true"
-         processIsolation="true"
-         stopOnFailure="true"
-         syntaxCheck="false"
-         testSuiteLoaderClass="PHPUnit_Runner_StandardTestSuiteLoader">
-<filter>
-  <blacklist>
-    <directory suffix=".php">/path/to/files</directory>
-    <file>/path/to/file</file>
-    <exclude>
-      <directory suffix=".php">/path/to/files</directory>
-      <file>/path/to/file</file>
-    </exclude>
-  </blacklist>
-  <whitelist>
-    <directory suffix=".php">/path/to/files</directory>
-    <file>/path/to/file</file>
-    <exclude>
-      <directory suffix=".php">/path/to/files</directory>
-      <file>/path/to/file</file>
-    </exclude>
-  </whitelist>
-</filter>
-</phpunit>

+ 10 - 0
test/phpunittestko.xml

@@ -0,0 +1,10 @@
+<phpunit>
+<filter>
+  <blacklist>
+    <directory suffix=".php">../test/</directory>
+  </blacklist>
+  <whitelist>
+    <directory suffix=".php">../htdocs/</directory>
+  </whitelist>
+</filter>
+</phpunit>

+ 7 - 0
test/phpunittestok.xml

@@ -0,0 +1,7 @@
+<phpunit>
+<filter>
+  <blacklist>
+    <directory suffix=".php">../test/</directory>
+  </blacklist>
+</filter>
+</phpunit>