Fixing tests

This commit is contained in:
Philipp Holzer 2019-02-17 21:41:45 +01:00
parent 5e5c39b0e1
commit f5adbd268b
No known key found for this signature in database
GPG key ID: 517BE60E2CE5C8A5
18 changed files with 101 additions and 93 deletions

View file

@ -32,14 +32,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, false)
->with('config', 'test')
->andReturn('now')
->twice();
@ -50,9 +50,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, false)
->with('config', 'test')
->andReturn('now')
->once();
@ -62,9 +62,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, false)
->with('config', 'test')
->andReturn(null)
->once();
@ -77,9 +77,9 @@ class ConfigConsoleTest extends ConsoleTest
function testSetArrayValue() {
$testArray = [1, 2, 3];
$this->configCache
$this->configMock
->shouldReceive('get')
->with('config', 'test', null, false)
->with('config', 'test')
->andReturn($testArray)
->once();
@ -105,9 +105,9 @@ class ConfigConsoleTest extends ConsoleTest
}
function testVerbose() {
$this->configCache
$this->configMock
->shouldReceive('get')
->with('test', 'it', null, false)
->with('test', 'it')
->andReturn('now')
->once();
$console = new Config($this->consoleArgv);
@ -133,14 +133,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, false)
->with('test', 'it')
->andReturn(NULL)
->once();
$console = new Config();