summaryrefslogtreecommitdiff
path: root/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/PHPUnitCompat.php
diff options
context:
space:
mode:
Diffstat (limited to 'www/wiki/extensions/SemanticMediaWiki/tests/phpunit/PHPUnitCompat.php')
-rw-r--r--www/wiki/extensions/SemanticMediaWiki/tests/phpunit/PHPUnitCompat.php31
1 files changed, 31 insertions, 0 deletions
diff --git a/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/PHPUnitCompat.php b/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/PHPUnitCompat.php
new file mode 100644
index 00000000..0ce51bd9
--- /dev/null
+++ b/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/PHPUnitCompat.php
@@ -0,0 +1,31 @@
+<?php
+
+namespace SMW\Tests;
+
+/**
+ * @license GNU GPL v2+
+ * @since 3.0
+ *
+ * @author mwjames
+ */
+trait PHPUnitCompat {
+
+ /**
+ * @see PHPUnit_Framework_TestCase::setExpectedException
+ */
+ public function setExpectedException( $name, $message = '', $code = null ) {
+ if ( is_callable( [ $this, 'expectException' ] ) ) {
+ if ( $name !== null ) {
+ $this->expectException( $name );
+ }
+ if ( $message !== '' ) {
+ $this->expectExceptionMessage( $message );
+ }
+ if ( $code !== null ) {
+ $this->expectExceptionCode( $code );
+ }
+ } else {
+ parent::setExpectedException( $name, $message, $code );
+ }
+ }
+} \ No newline at end of file