From: nupplaPhil Date: Sat, 21 Dec 2019 20:15:16 +0000 (+0100) Subject: Fix mock test (remove "implicit" usage of previous Dice-setups) X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=8a072b7fb33e05f9b9e905fb7946f84cd4e9438e;p=friendica.git Fix mock test (remove "implicit" usage of previous Dice-setups) --- diff --git a/tests/src/Core/SystemTest.php b/tests/src/Core/SystemTest.php index a385d1b352..af8d2f8f73 100644 --- a/tests/src/Core/SystemTest.php +++ b/tests/src/Core/SystemTest.php @@ -2,11 +2,26 @@ namespace Friendica\Test\src\Core; +use Dice\Dice; +use Friendica\App\BaseURL; use Friendica\Core\System; +use Friendica\DI; use PHPUnit\Framework\TestCase; class SystemTest extends TestCase { + protected function setUp() + { + parent::setUp(); + + $baseUrl = \Mockery::mock(BaseURL::class); + $baseUrl->shouldReceive('getHostname')->andReturn('friendica.local')->once(); + $dice = \Mockery::mock(Dice::class); + $dice->shouldReceive('create')->with(BaseURL::class, [])->andReturn($baseUrl); + + DI::init($dice); + } + private function assertGuid($guid, $length, $prefix = '') { $length -= strlen($prefix);