Daniel Werner has submitted this change and it was merged.

Change subject: Improvements to PHPUnit runner code
......................................................................


Improvements to PHPUnit runner code

* The phpunit.php runner now properly forwards arguments to PHPUnit
* Added a PHPUnit xml config file with default settings and inclusion path

Change-Id: Ida13de815cf8f2ea9b4d8bf132d9c224fd8c7dc3
---
M RELEASE-NOTES
A phpunit.xml.dist
A tests/bootstrap.php
M tests/phpunit.php
4 files changed, 50 insertions(+), 8 deletions(-)

Approvals:
  Daniel Werner: Verified; Looks good to me, approved
  jenkins-bot: Verified



diff --git a/RELEASE-NOTES b/RELEASE-NOTES
index 3d412e2..84bffbf 100644
--- a/RELEASE-NOTES
+++ b/RELEASE-NOTES
@@ -17,6 +17,7 @@
 * Added phpunit.php runner in the tests directory
 * Added Diff\Comparer\ValueComparer interface with CallbackComparer and 
StrictComparer implementations
 * Added MapPatcher::setValueComparer to facilitate patching maps containing 
objects
+* Added PHPUnit configuration file using the new tests/bootstrap.php
 
 ; Removals
 
diff --git a/phpunit.xml.dist b/phpunit.xml.dist
new file mode 100644
index 0000000..2e31e7d
--- /dev/null
+++ b/phpunit.xml.dist
@@ -0,0 +1,20 @@
+<phpunit backupGlobals="false"
+         backupStaticAttributes="false"
+         bootstrap="tests/bootstrap.php"
+         cacheTokens="false"
+         colors="true"
+         convertErrorsToExceptions="true"
+         convertNoticesToExceptions="true"
+         convertWarningsToExceptions="true"
+         stopOnError="false"
+         stopOnFailure="false"
+         stopOnIncomplete="false"
+         stopOnSkipped="false"
+         strict="true"
+         verbose="true">
+    <testsuites>
+        <testsuite name="Diff">
+            <directory>tests</directory>
+        </testsuite>
+    </testsuites>
+</phpunit>
diff --git a/tests/bootstrap.php b/tests/bootstrap.php
new file mode 100644
index 0000000..5788a07
--- /dev/null
+++ b/tests/bootstrap.php
@@ -0,0 +1,15 @@
+<?php
+
+/**
+ * PHPUnit test bootstrap file for the Diff library.
+ *
+ * @since 0.6
+ *
+ * @file
+ * @ingroup Diff
+ *
+ * @licence GNU GPL v2+
+ * @author Jeroen De Dauw < jeroended...@gmail.com >
+ */
+
+require_once( __DIR__ . '/../Diff.php' );
diff --git a/tests/phpunit.php b/tests/phpunit.php
index 7f44963..e0bfc4f 100755
--- a/tests/phpunit.php
+++ b/tests/phpunit.php
@@ -10,13 +10,19 @@
 
 require_once( 'PHPUnit/Autoload.php' );
 
-require_once( __DIR__ . '/../Diff.php' );
+require_once( __DIR__ . '/bootstrap.php' );
+
+echo 'Running tests for Diff version ' . Diff_VERSION . ".\n";
+
+$arguments = $_SERVER['argv'];
+array_shift( $arguments );
+
+if ( array_search( '--group', $arguments ) === false ) {
+       $arguments[] = '--group';
+       $arguments[] = 'Diff';
+}
+
+$arguments[] = __DIR__;
 
 $runner = new PHPUnit_TextUI_Command();
-
-$runner->run( array(
-   __FILE__,
-   '--group',
-   'Diff',
-   __DIR__
-) );
\ No newline at end of file
+$runner->run( $arguments );

-- 
To view, visit https://gerrit.wikimedia.org/r/62821
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ida13de815cf8f2ea9b4d8bf132d9c224fd8c7dc3
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Diff
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw <jeroended...@gmail.com>
Gerrit-Reviewer: Daniel Werner <daniel.wer...@wikimedia.de>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to