Add Drone CI

- Add drone test environment
- Add drone config
- apt phpunit
- Fix api.php
- Fix item.php
- Fix DBStructure
- Check if caching is possible during tests
This commit is contained in:
Philipp Holzer 2019-09-16 14:47:49 +02:00
parent b51dedd7e7
commit d5dd12b8f8
No known key found for this signature in database
GPG key ID: D8365C3D36B77D90
19 changed files with 321 additions and 34 deletions

View file

@ -16,10 +16,12 @@ class RedisCacheLockTest extends LockTest
{
$configMock = \Mockery::mock(Configuration::class);
$host = $_SERVER['REDIS_HOST'] ?? 'localhost';
$configMock
->shouldReceive('get')
->with('system', 'redis_host')
->andReturn('localhost');
->andReturn($host);
$configMock
->shouldReceive('get')
->with('system', 'redis_port')
@ -34,6 +36,15 @@ class RedisCacheLockTest extends LockTest
->with('system', 'redis_password')
->andReturn(null);
return new CacheLock(new RedisCache('localhost', $configMock));
$lock = null;
try {
$cache = new RedisCache($host, $configMock);
$lock = new CacheLock($cache);
} catch (\Exception $e) {
$this->markTestSkipped('Redis is not available');
}
return $lock;
}
}