<?php
/**
- * @copyright Copyright (C) 2020, Friendica
+ * @copyright Copyright (C) 2010-2022, the Friendica project
*
* @license GNU AGPL version 3 or any later version
*
use Dice\Dice;
use Friendica\App;
use Friendica\Console\AutomaticInstallation;
-use Friendica\Core\Config\Cache;
+use Friendica\Core\Config\ValueObject\Cache;
use Friendica\Core\Installer;
use Friendica\Core\L10n;
use Friendica\Core\Logger;
use Friendica\Database\Database;
use Friendica\DI;
-use Friendica\Test\Util\DBAMockTrait;
-use Friendica\Test\Util\DBStructureMockTrait;
use Friendica\Test\Util\RendererMockTrait;
use Friendica\Test\Util\VFSTrait;
-use Friendica\Util\Logger\VoidLogger;
+use Mockery;
use Mockery\MockInterface;
use org\bovigo\vfs\vfsStream;
use org\bovigo\vfs\vfsStreamFile;
+use Psr\Log\NullLogger;
class AutomaticInstallationConsoleTest extends ConsoleTest
{
use VFSTrait;
- use DBAMockTrait;
- use DBStructureMockTrait;
use RendererMockTrait;
/**
private $assertFileDb;
/**
- * @var Cache The configuration cache to check after each test
+ * @var \Friendica\Core\Config\ValueObject\Cache The configuration cache to check after each test
*/
private $configCache;
*/
private $dice;
- public function setUp()
+ public function setUp() : void
{
- $this->markTestSkipped('Needs class \'Installer\' as constructing argument for console tests');
+ static::markTestSkipped('Needs class \'Installer\' as constructing argument for console tests');
parent::setUp();
$this->root->getChild('config')
->removeChild('local.config.php');
}
- $this->dice = \Mockery::mock(Dice::class)->makePartial();
+ $this->dice = Mockery::mock(Dice::class)->makePartial();
- $l10nMock = \Mockery::mock(L10n::class);
+ $l10nMock = Mockery::mock(L10n::class);
$l10nMock->shouldReceive('t')->andReturnUsing(function ($args) { return $args; });
$this->dice->shouldReceive('create')
});
$this->mode->shouldReceive('isInstall')->andReturn(true);
- Logger::init(new VoidLogger());
+ Logger::init(new NullLogger());
}
/**
$this->mockUpdate([$this->root->url(), false, true, true], null, 1);
$this->mockGetMarkupTemplate('local.config.tpl', 'testTemplate', 1);
- $this->mockReplaceMacros('testTemplate', \Mockery::any(), '', 1);
+ $this->mockReplaceMacros('testTemplate', Mockery::any(), '', 1);
$console = new AutomaticInstallation($this->consoleArgv);
$console->setOption('url', 'http://friendica.local');
'password' => '{$conf('database', 'password')}',
'database' => '{$conf('database', 'database')}',
'charset' => 'utf8mb4',
+ 'pdo_emulate_prepares' => false,
],
// ****************************************************************
$this->mockUpdate([$this->root->url(), false, true, true], null, 1);
$this->mockGetMarkupTemplate('local.config.tpl', 'testTemplate', 1);
- $this->mockReplaceMacros('testTemplate', \Mockery::any(), '', 1);
+ $this->mockReplaceMacros('testTemplate', Mockery::any(), '', 1);
self::assertTrue(putenv('MYSQL_HOST=' . $data['database']['hostname']));
self::assertTrue(putenv('MYSQL_PORT=' . $data['database']['port']));
$this->mockUpdate([$this->root->url(), false, true, true], null, 1);
$this->mockGetMarkupTemplate('local.config.tpl', 'testTemplate', 1);
- $this->mockReplaceMacros('testTemplate', \Mockery::any(), '', 1);
+ $this->mockReplaceMacros('testTemplate', Mockery::any(), '', 1);
self::assertTrue(putenv('MYSQL_HOST=' . $data['database']['hostname']));
self::assertTrue(putenv('MYSQL_PORT=' . $data['database']['port']));
$this->mockUpdate([$this->root->url(), false, true, true], null, 1);
$this->mockGetMarkupTemplate('local.config.tpl', 'testTemplate', 1);
- $this->mockReplaceMacros('testTemplate', \Mockery::any(), '', 1);
+ $this->mockReplaceMacros('testTemplate', Mockery::any(), '', 1);
$console = new AutomaticInstallation($this->consoleArgv);
$this->mockConnect(false, 1);
$this->mockGetMarkupTemplate('local.config.tpl', 'testTemplate', 1);
- $this->mockReplaceMacros('testTemplate', \Mockery::any(), '', 1);
+ $this->mockReplaceMacros('testTemplate', Mockery::any(), '', 1);
$console = new AutomaticInstallation($this->consoleArgv);
$console->setOption('url', 'http://friendica.local');