use Dice\Dice;
use Friendica\App;
-use Friendica\BaseObject;
use Friendica\Core\Config;
+use Friendica\DI;
use Friendica\Render\FriendicaSmartyEngine;
use Friendica\Util\Profiler;
use Mockery\MockInterface;
protected $app;
/**
- * @var MockInterface|Config\Configuration The mocked Config Cache
+ * @var MockInterface|Config\IConfiguration The mocked Config Cache
*/
protected $configMock;
$config = new Config\JitConfiguration($this->configMock, $configModel);
$this->dice->shouldReceive('create')
- ->with(Config\Configuration::class)
+ ->with(Config\IConfiguration::class)
->andReturn($config);
// Mocking App and most used functions
->shouldReceive('getBasePath')
->andReturn($root->url());
- $this->app
- ->shouldReceive('getMode')
- ->andReturn($this->mode);
-
$this->profilerMock = \Mockery::mock(Profiler::class);
$this->profilerMock->shouldReceive('saveTimestamp');
$this->dice->shouldReceive('create')
$this->app
->shouldReceive('getConfigCache')
->andReturn($this->configMock);
- $this->app
- ->shouldReceive('getConfig')
- ->andReturn($config);
$this->app
->shouldReceive('getTemplateEngine')
->andReturn(new FriendicaSmartyEngine());
$this->app
->shouldReceive('getCurrentTheme')
->andReturn('Smarty3');
- $this->app
- ->shouldReceive('getProfiler')
- ->andReturn($this->profilerMock);
- $this->app
- ->shouldReceive('getBaseUrl')
- ->andReturnUsing(function () {
- return $this->configMock->get('system', 'url');
- });
- BaseObject::setDependencyInjection($this->dice);
+ DI::init($this->dice);
if ($raw) {
return;