1
1
Fork 0

Bugfixing AutomaticInstallation test

This commit is contained in:
Philipp Holzer 2019-02-04 00:04:16 +01:00
commit 90e88d6c35
No known key found for this signature in database
GPG key ID: 517BE60E2CE5C8A5
9 changed files with 37 additions and 25 deletions

View file

@ -4,6 +4,7 @@ namespace Friendica\Test\Util;
use Friendica\App;
use Friendica\BaseObject;
use Friendica\Core\Config\ConfigCache;
use Friendica\Render\FriendicaSmartyEngine;
use Mockery\MockInterface;
use org\bovigo\vfs\vfsStreamDirectory;
@ -24,8 +25,9 @@ trait AppMockTrait
* Mock the App
*
* @param vfsStreamDirectory $root The root directory
* @param MockInterface|ConfigCache $config The config cache
*/
public function mockApp($root)
public function mockApp($root, $config)
{
$this->mockConfigGet('system', 'theme', 'testtheme');
@ -35,22 +37,26 @@ trait AppMockTrait
->shouldReceive('getBasePath')
->andReturn($root->url());
$this->app
->shouldReceive('getConfigValue')
$config
->shouldReceive('get')
->with('database', 'hostname')
->andReturn(getenv('MYSQL_HOST'));
$this->app
->shouldReceive('getConfigValue')
$config
->shouldReceive('get')
->with('database', 'username')
->andReturn(getenv('MYSQL_USERNAME'));
$this->app
->shouldReceive('getConfigValue')
$config
->shouldReceive('get')
->with('database', 'password')
->andReturn(getenv('MYSQL_PASSWORD'));
$this->app
->shouldReceive('getConfigValue')
$config
->shouldReceive('get')
->with('database', 'database')
->andReturn(getenv('MYSQL_DATABASE'));
$this->app
->shouldReceive('getConfig')
->andReturn($config);
$this->app
->shouldReceive('getTemplateEngine')
->andReturn(new FriendicaSmartyEngine());