X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=tests%2Fsrc%2FCore%2FConsole%2FConfigConsoleTest.php;h=ef50c19b7271a895acf592486522fb990810facf;hb=b06fc578804fdc0073631e7c97eccd25543e769e;hp=505c4f794dc58db64f1299d673798e2cb7c14a70;hpb=b912823ea9a0874ff4c6c827fd2eb8a4cf7814b5;p=friendica.git diff --git a/tests/src/Core/Console/ConfigConsoleTest.php b/tests/src/Core/Console/ConfigConsoleTest.php index 505c4f794d..ef50c19b72 100644 --- a/tests/src/Core/Console/ConfigConsoleTest.php +++ b/tests/src/Core/Console/ConfigConsoleTest.php @@ -2,6 +2,7 @@ namespace Friendica\Test\src\Core\Console; +use Friendica\App\Mode; use Friendica\Core\Console\Config; /** @@ -16,12 +17,12 @@ class ConfigConsoleTest extends ConsoleTest parent::setUp(); \Mockery::getConfiguration()->setConstantsMap([ - 'Friendica\App\Mode' => [ + Mode::class => [ 'DBCONFIGAVAILABLE' => 0 ] ]); - $mode = \Mockery::mock('Friendica\App\Mode'); + $mode = \Mockery::mock(Mode::class); $mode ->shouldReceive('has') ->andReturn(true); @@ -32,14 +33,14 @@ class ConfigConsoleTest extends ConsoleTest } function testSetGetKeyValue() { - $this->configCache + $this->configMock ->shouldReceive('set') ->with('config', 'test', 'now') ->andReturn(true) ->once(); - $this->configCache + $this->configMock ->shouldReceive('get') - ->with('config', 'test', NULL) + ->with('config', 'test') ->andReturn('now') ->twice(); @@ -50,9 +51,9 @@ class ConfigConsoleTest extends ConsoleTest $txt = $this->dumpExecute($console); $this->assertEquals("config.test <= now\n", $txt); - $this->configCache + $this->configMock ->shouldReceive('get') - ->with('config', 'test', null) + ->with('config', 'test') ->andReturn('now') ->once(); @@ -62,9 +63,9 @@ class ConfigConsoleTest extends ConsoleTest $txt = $this->dumpExecute($console); $this->assertEquals("config.test => now\n", $txt); - $this->configCache + $this->configMock ->shouldReceive('get') - ->with('config', 'test', null) + ->with('config', 'test') ->andReturn(null) ->once(); @@ -77,9 +78,9 @@ class ConfigConsoleTest extends ConsoleTest function testSetArrayValue() { $testArray = [1, 2, 3]; - $this->configCache + $this->configMock ->shouldReceive('get') - ->with('config', 'test', null) + ->with('config', 'test') ->andReturn($testArray) ->once(); @@ -105,9 +106,9 @@ class ConfigConsoleTest extends ConsoleTest } function testVerbose() { - $this->configCache + $this->configMock ->shouldReceive('get') - ->with('test', 'it', null) + ->with('test', 'it') ->andReturn('now') ->once(); $console = new Config($this->consoleArgv); @@ -133,14 +134,14 @@ CONF; } function testUnableToSet() { - $this->configCache + $this->configMock ->shouldReceive('set') ->with('test', 'it', 'now') ->andReturn(false) ->once(); - $this->configCache + $this->configMock ->shouldReceive('get') - ->with('test', 'it', NULL) + ->with('test', 'it') ->andReturn(NULL) ->once(); $console = new Config();