From c869417759952654c3918b1f096c07bdaa4c9966 Mon Sep 17 00:00:00 2001 From: Franz Liedke Date: Thu, 21 Nov 2019 00:51:11 +0100 Subject: [PATCH] Automatically set up Mockery for unit tests - Use provided PhpUnit listener to enforce verification of expectations. - Include Mockery's trait to auto-close Mockery after each test. --- php-packages/testing/tests/unit/TestCase.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 php-packages/testing/tests/unit/TestCase.php diff --git a/php-packages/testing/tests/unit/TestCase.php b/php-packages/testing/tests/unit/TestCase.php new file mode 100644 index 000000000..8c87018b6 --- /dev/null +++ b/php-packages/testing/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; +}