]> git.mxchange.org Git - friendica.git/blobdiff - tests/src/Core/Console/ConfigConsoleTest.php
Merge pull request #6704 from tobiasd/20190220-credits
[friendica.git] / tests / src / Core / Console / ConfigConsoleTest.php
index 505c4f794dc58db64f1299d673798e2cb7c14a70..ef50c19b7271a895acf592486522fb990810facf 100644 (file)
@@ -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();