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

@ -27,8 +27,7 @@ abstract class LockTest extends MockedTest
{
// Reusable App object
$this->setUpVfsDir();
$configMock = \Mockery::mock('Friendica\Core\Config\Configuration');
$this->mockApp($this->root, $configMock);
$this->mockApp($this->root);
$this->app
->shouldReceive('getHostname')
->andReturn('friendica.local');

View file

@ -13,14 +13,14 @@ class MemcacheCacheLockDriverTest extends LockTest
{
protected function getInstance()
{
$this->configCache
$this->configMock
->shouldReceive('get')
->with('system', 'memcache_host', NULL, false)
->with('system', 'memcache_host')
->andReturn('localhost');
$this->configCache
$this->configMock
->shouldReceive('get')
->with('system', 'memcache_port', NULL, false)
->with('system', 'memcache_port')
->andReturn(11211);
return new CacheLockDriver(CacheDriverFactory::create('memcache'));

View file

@ -13,9 +13,9 @@ class MemcachedCacheLockDriverTest extends LockTest
{
protected function getInstance()
{
$this->configCache
$this->configMock
->shouldReceive('get')
->with('system', 'memcached_hosts', NULL, false)
->with('system', 'memcached_hosts')
->andReturn([0 => 'localhost, 11211']);
return new CacheLockDriver(CacheDriverFactory::create('memcached'));

View file

@ -13,14 +13,14 @@ class RedisCacheLockDriverTest extends LockTest
{
protected function getInstance()
{
$this->configCache
$this->configMock
->shouldReceive('get')
->with('system', 'redis_host', NULL, false)
->with('system', 'redis_host')
->andReturn('localhost');
$this->configCache
$this->configMock
->shouldReceive('get')
->with('system', 'redis_port', NULL, false)
->with('system', 'redis_port')
->andReturn(null);
return new CacheLockDriver(CacheDriverFactory::create('redis'));

View file

@ -12,9 +12,9 @@ class SemaphoreLockDriverTest extends LockTest
$this->app->shouldReceive('getHostname')->andReturn('friendica.local');
$this->configCache
$this->configMock
->shouldReceive('get')
->with('system', 'temppath', NULL, false)
->with('system', 'temppath')
->andReturn('/tmp/');
}