diff --git a/autotest-external.sh b/autotest-external.sh
index 9d9d42cee35d7eb1074d52bfd8936e9e58324581..7d2e506ae9811c9d20d23f107f6c77dcbdce3e3f 100755
--- a/autotest-external.sh
+++ b/autotest-external.sh
@@ -31,7 +31,7 @@ function print_syntax {
 }
 
 if ! [ -x "$PHPUNIT" ]; then
-	echo "phpunit executable not found, please install phpunit version >= 3.7" >&2
+	echo "phpunit executable not found, please install phpunit version >= 4.8" >&2
 	exit 3
 fi
 
@@ -39,8 +39,8 @@ PHPUNIT_VERSION=$("$PHPUNIT" --version | cut -d" " -f2)
 PHPUNIT_MAJOR_VERSION=$(echo $PHPUNIT_VERSION | cut -d"." -f1)
 PHPUNIT_MINOR_VERSION=$(echo $PHPUNIT_VERSION | cut -d"." -f2)
 
-if ! [ $PHPUNIT_MAJOR_VERSION -gt 4 -o \( $PHPUNIT_MAJOR_VERSION -eq 4 -a $PHPUNIT_MINOR_VERSION -ge 4 \) ]; then
-	echo "phpunit version >= 4.4 required. Version found: $PHPUNIT_VERSION" >&2
+if ! [ $PHPUNIT_MAJOR_VERSION -gt 4 -o \( $PHPUNIT_MAJOR_VERSION -eq 4 -a $PHPUNIT_MINOR_VERSION -ge 8 \) ]; then
+	echo "phpunit version >= 4.8 required. Version found: $PHPUNIT_VERSION" >&2
 	exit 4
 fi
 
diff --git a/autotest.sh b/autotest.sh
index 5f5633fcf0f4fdd7d54aa04704132ed8233c02ab..022d4ecd4b6b6a088ff52636d3c88875bcf1d0ee 100755
--- a/autotest.sh
+++ b/autotest.sh
@@ -54,7 +54,7 @@ else
 fi
 
 if ! [ -x "$PHPUNIT" ]; then
-	echo "phpunit executable not found, please install phpunit version >= 4.4" >&2
+	echo "phpunit executable not found, please install phpunit version >= 4.8" >&2
 	exit 3
 fi
 
@@ -69,8 +69,8 @@ PHPUNIT_VERSION=$($PHPUNIT --version | cut -d" " -f2)
 PHPUNIT_MAJOR_VERSION=$(echo "$PHPUNIT_VERSION" | cut -d"." -f1)
 PHPUNIT_MINOR_VERSION=$(echo "$PHPUNIT_VERSION" | cut -d"." -f2)
 
-if ! [ "$PHPUNIT_MAJOR_VERSION" -gt 4 -o \( "$PHPUNIT_MAJOR_VERSION" -eq 4 -a "$PHPUNIT_MINOR_VERSION" -ge 4 \) ]; then
-	echo "phpunit version >= 4.4 required. Version found: $PHPUNIT_VERSION" >&2
+if ! [ "$PHPUNIT_MAJOR_VERSION" -gt 4 -o \( "$PHPUNIT_MAJOR_VERSION" -eq 4 -a "$PHPUNIT_MINOR_VERSION" -ge 8 \) ]; then
+	echo "phpunit version >= 4.8 required. Version found: $PHPUNIT_VERSION" >&2
 	exit 4
 fi
 
diff --git a/tests/lib/TestCase.php b/tests/lib/TestCase.php
index f5d65679c9071b89109012bd90da06c83af50125..0389ef5d46b3220b8f5c155ad8f7853384655c79 100644
--- a/tests/lib/TestCase.php
+++ b/tests/lib/TestCase.php
@@ -47,6 +47,24 @@ abstract class TestCase extends \PHPUnit_Framework_TestCase {
 	/** @var array */
 	protected $services = [];
 
+	/**
+	 * Wrapper to be forward compatible to phpunit 5.4+
+	 *
+	 * @param string $originalClassName
+	 * @return \PHPUnit_Framework_MockObject_MockObject
+	 */
+	protected function createMock($originalClassName) {
+		if (is_callable('parent::createMock')) {
+			return parent::createMock($originalClassName);
+		}
+
+		return $this->getMockBuilder($originalClassName)
+			->disableOriginalConstructor()
+			->disableOriginalClone()
+			->disableArgumentCloning()
+			->getMock();
+	}
+
 	/**
 	 * @param string $name
 	 * @param mixed $newService