View Issue Details

IDProjectCategoryView StatusLast Update
0010021mantisbttoolspublic2011-08-02 12:35
Reporterrombert Assigned Torombert  
PrioritynormalSeverityfeatureReproducibilityN/A
Status closedResolutionfixed 
Product Version1.2.7 
Target Version1.2.7Fixed in Version1.2.2 
Summary0010021: Run PHPUnit tests using Phing
Description

The attached series of 3 patches:

a) create a small phing build file which executes the PHPUnit tests
b) add a section to the developers guide which briefly explains how to run the tests
c) updates the .gitignore file which files generated by PDT 2.0

Patches apply cleanly on top of 5e1d1917659bf7fcdeabca206b71f36ac99792fd

TagsNo tags attached.
Attached Files
0001-Add-support-for-running-phpunit-tests-using-phing.patch (1,283 bytes)   
From 5a21cec13108f99c2e4611366ed7f921784f9a48 Mon Sep 17 00:00:00 2001
From: Robert Munteanu <robert.munteanu@gmail.com>
Date: Tue, 6 Jan 2009 12:33:09 +0200
Subject: [PATCH] Add support for running phpunit tests using phing

---
 .gitignore |    5 ++++-
 build.xml  |   22 ++++++++++++++++++++++
 2 files changed, 26 insertions(+), 1 deletions(-)
 create mode 100644 build.xml

diff --git a/.gitignore b/.gitignore
index 35acc9d..e358082 100644
--- a/.gitignore
+++ b/.gitignore
@@ -16,4 +16,7 @@ docbook/*/*/install
 .project
 
 # IIS7 
-web.config
\ No newline at end of file
+web.config
+
+# build files from test
+build
diff --git a/build.xml b/build.xml
new file mode 100644
index 0000000..adf91ec
--- /dev/null
+++ b/build.xml
@@ -0,0 +1,22 @@
+<project name="MantisBT" default="build">
+ <target name="clean">
+  <delete dir="build"/>
+ </target>
+
+ <target name="prepare">
+  <mkdir dir="build/logs"/>
+ </target>
+
+ <target name="phpunit">
+  <phpunit printsummary="true" haltonfailure="true">
+    <formatter todir="build/logs" type="xml"/>
+    <batchtest>
+      <fileset dir="tests">
+        <include name="*Test.php"/>
+      </fileset>
+    </batchtest>
+  </phpunit>
+ </target>
+
+ <target name="build" depends="clean,prepare,phpunit"/>
+</project>
-- 
1.6.0.2

0002-Update-dev-guide-to-explain-how-to-run-tests-using-p.patch (2,051 bytes)   
From 1cdda909b51bba07feccec4e656641ef1b02a488 Mon Sep 17 00:00:00 2001
From: Robert Munteanu <robert.munteanu@gmail.com>
Date: Tue, 6 Jan 2009 12:50:26 +0200
Subject: [PATCH] Update dev guide to explain how to run tests using phing

---
 docbook/developers/en/developers.sgml   |    1 +
 docbook/developers/en/file-entities.ent |    1 +
 docbook/developers/en/unit-tests.sgml   |   20 ++++++++++++++++++++
 3 files changed, 22 insertions(+), 0 deletions(-)
 create mode 100644 docbook/developers/en/unit-tests.sgml

diff --git a/docbook/developers/en/developers.sgml b/docbook/developers/en/developers.sgml
index 1e15dbd..7e9661b 100644
--- a/docbook/developers/en/developers.sgml
+++ b/docbook/developers/en/developers.sgml
@@ -41,6 +41,7 @@
 	&events;
 	&plugins;
 	&eventref;
+	&unit-tests;
 
 	&appendix;
 </book>
diff --git a/docbook/developers/en/file-entities.ent b/docbook/developers/en/file-entities.ent
index 95ee67b..c3960e0 100644
--- a/docbook/developers/en/file-entities.ent
+++ b/docbook/developers/en/file-entities.ent
@@ -7,5 +7,6 @@
 <!ENTITY eventref SYSTEM "event-reference.sgml">
 <!ENTITY eventref-output SYSTEM "event-reference-output.sgml">
 <!ENTITY eventref-bug SYSTEM "event-reference-bug.sgml">
+<!ENTITY unit-tests SYSTEM "unit-tests.sgml">
 
 <!ENTITY appendix SYSTEM "appendix.sgml">
diff --git a/docbook/developers/en/unit-tests.sgml b/docbook/developers/en/unit-tests.sgml
new file mode 100644
index 0000000..5826fcc
--- /dev/null
+++ b/docbook/developers/en/unit-tests.sgml
@@ -0,0 +1,20 @@
+<chapter id="dev.unittests">
+	<title>Unit tests</title>
+
+	<sect1 id="dev.unittests.req">
+		<title>Requirements</title>
+
+		<para>
+                	Tests are run using <ulink url="http://phing.org">Phing</ulink> and
+                        <ulink url="http://www.phpunit.de">PHPUnit</ulink>.
+		</para>
+	</sect1>
+
+	<sect1 id="dev.unittests.run">
+		<title>Running the tests</title>
+
+		<para>
+			To run the tests execute <literal>phing</literal> in the project root.
+		</para>
+	</sect1>
+</chapter>
-- 
1.6.0.2

0003-Updated-.gitignore-for-PDT-2.0-files.patch (509 bytes)   
From 7b1473c4c8533cd7fcc59e0c8206caec63a6d29a Mon Sep 17 00:00:00 2001
From: Robert Munteanu <robert.munteanu@gmail.com>
Date: Tue, 6 Jan 2009 12:51:23 +0200
Subject: [PATCH] Updated .gitignore for PDT 2.0 files

---
 .gitignore |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/.gitignore b/.gitignore
index e358082..487da94 100644
--- a/.gitignore
+++ b/.gitignore
@@ -14,6 +14,8 @@ docbook/*/*/install
 *~
 *.swp
 .project
+.buildpath
+.settings
 
 # IIS7 
 web.config
-- 
1.6.0.2

Relationships

has duplicate 0011333 closedrombert Run PHPUnit tests 

Activities

giallu

giallu

2009-01-06 10:39

reporter   ~0020544

forgot the patch?

rombert

rombert

2009-01-06 10:42

reporter   ~0020545

Obviously.

Pre-caffeine bug report.

rombert

rombert

2011-07-28 09:40

reporter   ~0029314

This was fixed a long time ago, for master-1.2.x only.