diff --git a/framework/core/tests/phpunit.unit.xml b/framework/core/tests/phpunit.unit.xml
index 770adad2b..eb4e32c11 100644
--- a/framework/core/tests/phpunit.unit.xml
+++ b/framework/core/tests/phpunit.unit.xml
@@ -19,4 +19,7 @@
./src/
+
+
+
diff --git a/framework/core/tests/unit/Foundation/ErrorHandling/ExceptionHandler/IlluminateValidationExceptionHandlerTest.php b/framework/core/tests/unit/Foundation/ErrorHandling/ExceptionHandler/IlluminateValidationExceptionHandlerTest.php
index 028fa5e33..d06d289ef 100644
--- a/framework/core/tests/unit/Foundation/ErrorHandling/ExceptionHandler/IlluminateValidationExceptionHandlerTest.php
+++ b/framework/core/tests/unit/Foundation/ErrorHandling/ExceptionHandler/IlluminateValidationExceptionHandlerTest.php
@@ -12,11 +12,11 @@
namespace Flarum\Tests\unit\Foundation\ErrorHandling\ExceptionHandler;
use Flarum\Foundation\ErrorHandling\ExceptionHandler\IlluminateValidationExceptionHandler;
+use Flarum\Tests\unit\TestCase;
use Illuminate\Translation\ArrayLoader;
use Illuminate\Translation\Translator;
use Illuminate\Validation\Factory;
use Illuminate\Validation\ValidationException;
-use PHPUnit\Framework\TestCase;
class IlluminateValidationExceptionHandlerTest extends TestCase
{
diff --git a/framework/core/tests/unit/Foundation/ErrorHandling/ExceptionHandler/ValidationExceptionHandlerTest.php b/framework/core/tests/unit/Foundation/ErrorHandling/ExceptionHandler/ValidationExceptionHandlerTest.php
index 32062249d..d0179f05d 100644
--- a/framework/core/tests/unit/Foundation/ErrorHandling/ExceptionHandler/ValidationExceptionHandlerTest.php
+++ b/framework/core/tests/unit/Foundation/ErrorHandling/ExceptionHandler/ValidationExceptionHandlerTest.php
@@ -13,7 +13,7 @@ namespace Flarum\Tests\unit\Foundation\ErrorHandling\ExceptionHandler;
use Flarum\Foundation\ErrorHandling\ExceptionHandler\ValidationExceptionHandler;
use Flarum\Foundation\ValidationException;
-use PHPUnit\Framework\TestCase;
+use Flarum\Tests\unit\TestCase;
class ValidationExceptionHandlerTest extends TestCase
{
diff --git a/framework/core/tests/unit/Install/BaseUrlTest.php b/framework/core/tests/unit/Install/BaseUrlTest.php
index c4f1ca58d..b75543b7a 100644
--- a/framework/core/tests/unit/Install/BaseUrlTest.php
+++ b/framework/core/tests/unit/Install/BaseUrlTest.php
@@ -9,10 +9,10 @@
* file that was distributed with this source code.
*/
-namespace Flarum\Tests\unit;
+namespace Flarum\Tests\unit\Install;
use Flarum\Install\BaseUrl;
-use PHPUnit\Framework\TestCase;
+use Flarum\Tests\unit\TestCase;
use Zend\Diactoros\Uri;
class BaseUrlTest extends TestCase
diff --git a/framework/core/tests/unit/Settings/DatabaseSettingsRepositoryTest.php b/framework/core/tests/unit/Settings/DatabaseSettingsRepositoryTest.php
index c7188792d..64cf74ae7 100644
--- a/framework/core/tests/unit/Settings/DatabaseSettingsRepositoryTest.php
+++ b/framework/core/tests/unit/Settings/DatabaseSettingsRepositoryTest.php
@@ -12,9 +12,9 @@
namespace Flarum\Tests\unit\Settings;
use Flarum\Settings\DatabaseSettingsRepository;
+use Flarum\Tests\unit\TestCase;
use Illuminate\Database\ConnectionInterface;
use Mockery as m;
-use PHPUnit\Framework\TestCase;
class DatabaseSettingsRepositoryTest extends TestCase
{
diff --git a/framework/core/tests/unit/Settings/MemoryCacheSettingsRepositoryTest.php b/framework/core/tests/unit/Settings/MemoryCacheSettingsRepositoryTest.php
index aa2e35615..dd616f73c 100644
--- a/framework/core/tests/unit/Settings/MemoryCacheSettingsRepositoryTest.php
+++ b/framework/core/tests/unit/Settings/MemoryCacheSettingsRepositoryTest.php
@@ -13,8 +13,8 @@ namespace Flarum\Tests\unit\Settings;
use Flarum\Settings\MemoryCacheSettingsRepository;
use Flarum\Settings\SettingsRepositoryInterface;
+use Flarum\Tests\unit\TestCase;
use Mockery as m;
-use PHPUnit\Framework\TestCase;
class MemoryCacheSettingsRepositoryTest extends TestCase
{
diff --git a/framework/core/tests/unit/TestCase.php b/framework/core/tests/unit/TestCase.php
new file mode 100644
index 000000000..8c87018b6
--- /dev/null
+++ b/framework/core/tests/unit/TestCase.php
@@ -0,0 +1,20 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Flarum\Tests\unit;
+
+use Mockery\Adapter\Phpunit\MockeryPHPUnitIntegration;
+
+abstract class TestCase extends \PHPUnit\Framework\TestCase
+{
+ // Ensure Mockery is always torn down automatically after each test.
+ use MockeryPHPUnitIntegration;
+}