Jeroen De Dauw has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/62589


Change subject: Added phpunit.xml file
......................................................................

Added phpunit.xml file

so tests can be run with bootstrap and config from home dir without extra args

Change-Id: If9ccbe86b7254e79ac5f096103b5f85af7927daa
---
M Tests/Phpunit/phpunit.php
A Tests/bootstrap.php
A phpunit.xml.dist
3 files changed, 43 insertions(+), 14 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Ask 
refs/changes/89/62589/1

diff --git a/Tests/Phpunit/phpunit.php b/Tests/Phpunit/phpunit.php
index 66163d4..2ffaf53 100755
--- a/Tests/Phpunit/phpunit.php
+++ b/Tests/Phpunit/phpunit.php
@@ -10,20 +10,7 @@
 }
 require_once( 'PHPUnit/Autoload.php' );
 
-define( 'DATAVALUES', true );
-require_once( __DIR__ . '/../../Ask.php' );
-
-spl_autoload_register( function ( $className ) {
-       static $classes = false;
-
-       if ( $classes === false ) {
-               $classes = include(  __DIR__ . '/../AskTestClasses.php' );
-       }
-
-       if ( array_key_exists( $className, $classes ) ) {
-               include_once __DIR__ . '/../../../' . $classes[$className];
-       }
-} );
+require_once( __DIR__ . '/../bootstrap.php' );
 
 echo 'Running tests for Ask version ' . Ask_VERSION . ".\n";
 
diff --git a/Tests/bootstrap.php b/Tests/bootstrap.php
new file mode 100644
index 0000000..95507fd
--- /dev/null
+++ b/Tests/bootstrap.php
@@ -0,0 +1,27 @@
+<?php
+
+/**
+ * Test class registration file for the Ask library.
+ *
+ * @since 0.1
+ *
+ * @file
+ * @ingroup Ask
+ *
+ * @licence GNU GPL v2+
+ * @author Jeroen De Dauw < [email protected] >
+ */
+
+require_once( __DIR__ . '/../Ask.php' );
+
+spl_autoload_register( function ( $className ) {
+       static $classes = false;
+
+       if ( $classes === false ) {
+               $classes = include(  __DIR__ . '/AskTestClasses.php' );
+       }
+
+       if ( array_key_exists( $className, $classes ) ) {
+               include_once __DIR__ . '/../../' . $classes[$className];
+       }
+} );
\ No newline at end of file
diff --git a/phpunit.xml.dist b/phpunit.xml.dist
new file mode 100644
index 0000000..8c96eb6
--- /dev/null
+++ b/phpunit.xml.dist
@@ -0,0 +1,15 @@
+<phpunit backupGlobals="false"
+         backupStaticAttributes="false"
+         bootstrap="Tests/bootstrap.php"
+         cacheTokens="false"
+         colors="false"
+         convertErrorsToExceptions="true"
+         convertNoticesToExceptions="true"
+         convertWarningsToExceptions="true"
+         stopOnError="false"
+         stopOnFailure="false"
+         stopOnIncomplete="false"
+         stopOnSkipped="false"
+         strict="true"
+         verbose="true">
+</phpunit>

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If9ccbe86b7254e79ac5f096103b5f85af7927daa
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Ask
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to