X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=tests%2Fsrc%2FCore%2FConfig%2FPConfigurationTest.php;h=294a73bba46a920f574651ba6c89e85d843264bb;hb=cd41efe29de0aa712619faf7a07e209003639250;hp=8ecc9bdf379f092ff38ba0a3f87103ae71cf3bf9;hpb=e1d9d67632a8d6777a2b49c227b7a40d1014437c;p=friendica.git diff --git a/tests/src/Core/Config/PConfigurationTest.php b/tests/src/Core/Config/PConfigurationTest.php index 8ecc9bdf37..294a73bba4 100644 --- a/tests/src/Core/Config/PConfigurationTest.php +++ b/tests/src/Core/Config/PConfigurationTest.php @@ -1,7 +1,8 @@ shouldReceive('isConnected')->andReturn(true)->twice(); // expected loading $configAdapter->shouldReceive('load') @@ -51,7 +52,7 @@ class PConfigurationTest extends MockedTest { $uid = 234; $configCache = new ConfigCache(); - $configAdapter = \Mockery::mock('Friendica\Core\Config\Adapter\IPConfigAdapter'); + $configAdapter = \Mockery::mock(IPConfigAdapter::class); $configAdapter->shouldReceive('isConnected')->andReturn(true)->times(4); // expected loading $configAdapter->shouldReceive('load')->with($uid, 'testing')->andReturn(['testing' => ['test' => 'it']])->once(); @@ -77,7 +78,7 @@ class PConfigurationTest extends MockedTest { $uid = 234; $configCache = new ConfigCache(); - $configAdapter = \Mockery::mock('Friendica\Core\Config\Adapter\IPConfigAdapter'); + $configAdapter = \Mockery::mock(IPConfigAdapter::class); $configAdapter->shouldReceive('isConnected')->andReturn(false)->times(2); $configuration = new PConfiguration($configCache, $configAdapter); @@ -95,7 +96,7 @@ class PConfigurationTest extends MockedTest { $uid = 234; $configCache = new ConfigCache(); - $configAdapter = \Mockery::mock('Friendica\Core\Config\Adapter\IPConfigAdapter'); + $configAdapter = \Mockery::mock(IPConfigAdapter::class); $configAdapter->shouldReceive('isConnected')->andReturn(true)->times(2); $configAdapter->shouldReceive('isLoaded')->with($uid, 'test', 'it')->andReturn(true)->once(); $configAdapter->shouldReceive('set')->with($uid, 'test', 'it', $data)->andReturn(true)->once(); @@ -114,7 +115,7 @@ class PConfigurationTest extends MockedTest { $uid = 234; $configCache = new ConfigCache(); - $configAdapter = \Mockery::mock('Friendica\Core\Config\Adapter\IPConfigAdapter'); + $configAdapter = \Mockery::mock(IPConfigAdapter::class); $configAdapter->shouldReceive('isConnected')->andReturn(false)->times(3); $configuration = new PConfiguration($configCache, $configAdapter); @@ -137,14 +138,14 @@ class PConfigurationTest extends MockedTest { $uid = 234; $configCache = new ConfigCache(); - $configAdapter = \Mockery::mock('Friendica\Core\Config\Adapter\IPConfigAdapter'); + $configAdapter = \Mockery::mock(IPConfigAdapter::class); $configAdapter->shouldReceive('isConnected')->andReturn(true)->times(4); $configAdapter->shouldReceive('isLoaded')->with($uid, 'test', 'it')->andReturn(false)->once(); $configAdapter->shouldReceive('get')->with($uid, 'test', 'it')->andReturn('now')->once(); $configAdapter->shouldReceive('isLoaded')->with($uid, 'test', 'it')->andReturn(true)->twice(); $configAdapter->shouldReceive('get')->with($uid, 'test', 'it')->andReturn($data)->once(); $configAdapter->shouldReceive('isLoaded')->with($uid, 'test', 'not')->andReturn(false)->once(); - $configAdapter->shouldReceive('get')->with($uid, 'test', 'not')->andReturn('!!')->once(); + $configAdapter->shouldReceive('get')->with($uid, 'test', 'not')->andReturn(null)->once(); $configuration = new PConfiguration($configCache, $configAdapter); @@ -168,11 +169,11 @@ class PConfigurationTest extends MockedTest { $uid = 234; $configCache = new ConfigCache(); - $configAdapter = \Mockery::mock('Friendica\Core\Config\Adapter\IPConfigAdapter'); + $configAdapter = \Mockery::mock(IPConfigAdapter::class); $configAdapter->shouldReceive('isConnected')->andReturn(true)->times(3); $configAdapter->shouldReceive('isLoaded')->with($uid, 'test', 'it')->andReturn(false)->once(); - $configAdapter->shouldReceive('get')->with($uid, 'test', 'it')->andReturn('!!')->once(); + $configAdapter->shouldReceive('get')->with($uid, 'test', 'it')->andReturn(null)->once(); $configAdapter->shouldReceive('isLoaded')->with($uid, 'test', 'it')->andReturn(false)->once(); $configAdapter->shouldReceive('get')->with($uid, 'test', 'it')->andReturn($data)->once(); @@ -199,7 +200,7 @@ class PConfigurationTest extends MockedTest { $uid = 234; $configCache = new ConfigCache(); - $configAdapter = \Mockery::mock('Friendica\Core\Config\Adapter\IPConfigAdapter'); + $configAdapter = \Mockery::mock(IPConfigAdapter::class); $configAdapter->shouldReceive('isConnected')->andReturn(false)->times(4); $configuration = new PConfiguration($configCache, $configAdapter); @@ -218,7 +219,7 @@ class PConfigurationTest extends MockedTest { $uid = 234; $configCache = new ConfigCache(); - $configAdapter = \Mockery::mock('Friendica\Core\Config\Adapter\IPConfigAdapter'); + $configAdapter = \Mockery::mock(IPConfigAdapter::class); $configAdapter->shouldReceive('isConnected')->andReturn(true)->times(6); $configAdapter->shouldReceive('set')->with($uid, 'test', 'it', 'now')->andReturn(false)->once(); $configAdapter->shouldReceive('isLoaded')->with($uid, 'test', 'it')->andReturn(true)->once();