]> git.mxchange.org Git - friendica.git/blobdiff - tests/Util/AppMockTrait.php
Merge pull request #10813 from tobiasd/20211003-lengthcounter
[friendica.git] / tests / Util / AppMockTrait.php
index 1f6605390c557d335019007a64cdf326bfffde74..4266a4a0238c9fafea32882a102bafa15443a148 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2020, Friendica
+ * @copyright Copyright (C) 2010-2021, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -25,6 +25,7 @@ use Dice\Dice;
 use Friendica\App;
 use Friendica\Core\Config;
 use Friendica\DI;
+use Friendica\Network\HTTPException\InternalServerErrorException;
 use Friendica\Render\FriendicaSmartyEngine;
 use Friendica\Util\Profiler;
 use Mockery\MockInterface;
@@ -64,7 +65,9 @@ trait AppMockTrait
         * Mock the App
         *
         * @param vfsStreamDirectory $root The root directory
-        * @param bool $raw If true, no config mocking will be done
+        * @param bool               $raw  If true, no config mocking will be done
+        *
+        * @throws InternalServerErrorException
         */
        public function mockApp(vfsStreamDirectory $root, $raw = false)
        {
@@ -98,6 +101,8 @@ trait AppMockTrait
                        ->andReturn($root->url());
 
                $this->profilerMock = \Mockery::mock(Profiler::class);
+               $this->profilerMock->shouldReceive('startRecording');
+               $this->profilerMock->shouldReceive('stopRecording');
                $this->profilerMock->shouldReceive('saveTimestamp');
                $this->dice->shouldReceive('create')
                           ->with(Profiler::class)
@@ -108,11 +113,17 @@ trait AppMockTrait
                        ->andReturn($this->configMock);
                $this->app
                        ->shouldReceive('getTemplateEngine')
-                       ->andReturn(new FriendicaSmartyEngine());
+                       ->andReturn(new FriendicaSmartyEngine('frio', []));
                $this->app
                        ->shouldReceive('getCurrentTheme')
                        ->andReturn('Smarty3');
-
+               $this->app->shouldReceive('getThemeInfoValue')
+                       ->with('videowidth')
+                       ->andReturn(425);
+               $this->app->shouldReceive('getThemeInfoValue')
+                       ->with('videoheight')
+                       ->andReturn(350);
+       
                DI::init($this->dice);
 
                if ($raw) {