Fix mock test (remove "implicit" usage of previous Dice-setups)

This commit is contained in:
Philipp Holzer 2019-12-21 21:15:16 +01:00
parent c1dbb25656
commit 8a072b7fb3
No known key found for this signature in database
GPG key ID: D8365C3D36B77D90

View file

@ -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);