]> git.mxchange.org Git - friendica.git/blobdiff - tests/Util/AppMockTrait.php
Merge pull request #8128 from nupplaphil/task/di_static_methods
[friendica.git] / tests / Util / AppMockTrait.php
index f9a9cb25de41902d90187fe2966046f5322bd9a9..f0231b280da79b5139041b29c2f6879c5a6f775d 100644 (file)
@@ -22,7 +22,7 @@ trait AppMockTrait
        protected $app;
 
        /**
-        * @var MockInterface|Config\Configuration The mocked Config Cache
+        * @var MockInterface|Config\IConfiguration The mocked Config Cache
         */
        protected $configMock;
 
@@ -66,7 +66,7 @@ trait AppMockTrait
 
                $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
@@ -78,10 +78,6 @@ trait AppMockTrait
                        ->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')
@@ -91,23 +87,12 @@ trait AppMockTrait
                $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');
-                       });
 
                DI::init($this->dice);