mirror of
https://github.com/wallabag/wallabag.git
synced 2024-12-26 09:30:30 +00:00
Avoid failing test for user who didn’t install Redis
This commit is contained in:
parent
13a522dfbd
commit
0e0102b6fc
5 changed files with 19 additions and 0 deletions
|
@ -80,4 +80,19 @@ abstract class WallabagCoreTestCase extends WebTestCase
|
|||
|
||||
throw new \RuntimeException('No logged in User.');
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if Redis is installed.
|
||||
* If not, mark test as skip
|
||||
*/
|
||||
protected function checkRedis()
|
||||
{
|
||||
try {
|
||||
$this->client->getContainer()->get('wallabag_core.redis.client')->connect();
|
||||
} catch (\Exception $e) {
|
||||
$this->markTestSkipped(
|
||||
'Redis is not installed/activated'
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -34,6 +34,7 @@ class PocketControllerTest extends WallabagCoreTestCase
|
|||
|
||||
public function testImportPocketWithRedisEnabled()
|
||||
{
|
||||
$this->checkRedis();
|
||||
$this->logInAs('admin');
|
||||
$client = $this->getClient();
|
||||
|
||||
|
|
|
@ -54,6 +54,7 @@ class ReadabilityControllerTest extends WallabagCoreTestCase
|
|||
|
||||
public function testImportReadabilityWithRedisEnabled()
|
||||
{
|
||||
$this->checkRedis();
|
||||
$this->logInAs('admin');
|
||||
$client = $this->getClient();
|
||||
|
||||
|
|
|
@ -54,6 +54,7 @@ class WallabagV1ControllerTest extends WallabagCoreTestCase
|
|||
|
||||
public function testImportWallabagWithRedisEnabled()
|
||||
{
|
||||
$this->checkRedis();
|
||||
$this->logInAs('admin');
|
||||
$client = $this->getClient();
|
||||
|
||||
|
|
|
@ -54,6 +54,7 @@ class WallabagV2ControllerTest extends WallabagCoreTestCase
|
|||
|
||||
public function testImportWallabagWithRedisEnabled()
|
||||
{
|
||||
$this->checkRedis();
|
||||
$this->logInAs('admin');
|
||||
$client = $this->getClient();
|
||||
|
||||
|
|
Loading…
Reference in a new issue