Fix tests

This commit is contained in:
Philipp Holzer 2019-07-26 15:54:14 +02:00
parent 2a87464c97
commit 07aaf292ec
No known key found for this signature in database
GPG key ID: D8365C3D36B77D90
12 changed files with 134 additions and 144 deletions

View file

@ -3,6 +3,8 @@
// this is in the same namespace as Install for mocking 'function_exists'
namespace Friendica\Core;
use Dice\Dice;
use Friendica\BaseObject;
use Friendica\Core\Config\Cache\ConfigCache;
use Friendica\Network\CurlResult;
use Friendica\Object\Image;
@ -27,7 +29,16 @@ class InstallerTest extends MockedTest
$this->setUpVfsDir();
$this->l10nMock = \Mockery::mock(\Friendica\Core\L10n\L10n::class);
L10n::init($this->l10nMock);
/** @var Dice|MockInterface $dice */
$dice = \Mockery::mock(Dice::class)->makePartial();
$dice = $dice->addRules(include __DIR__ . '/../../../static/dependencies.config.php');
$dice->shouldReceive('create')
->with(\Friendica\Core\L10n\L10n::class)
->andReturn($this->l10nMock);
BaseObject::setDependencyInjection($dice);
}
private function mockL10nT(string $text, $times = null)