mirror of
https://github.com/wallabag/wallabag.git
synced 2024-11-29 12:31:02 +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.');
|
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()
|
public function testImportPocketWithRedisEnabled()
|
||||||
{
|
{
|
||||||
|
$this->checkRedis();
|
||||||
$this->logInAs('admin');
|
$this->logInAs('admin');
|
||||||
$client = $this->getClient();
|
$client = $this->getClient();
|
||||||
|
|
||||||
|
|
|
@ -54,6 +54,7 @@ class ReadabilityControllerTest extends WallabagCoreTestCase
|
||||||
|
|
||||||
public function testImportReadabilityWithRedisEnabled()
|
public function testImportReadabilityWithRedisEnabled()
|
||||||
{
|
{
|
||||||
|
$this->checkRedis();
|
||||||
$this->logInAs('admin');
|
$this->logInAs('admin');
|
||||||
$client = $this->getClient();
|
$client = $this->getClient();
|
||||||
|
|
||||||
|
|
|
@ -54,6 +54,7 @@ class WallabagV1ControllerTest extends WallabagCoreTestCase
|
||||||
|
|
||||||
public function testImportWallabagWithRedisEnabled()
|
public function testImportWallabagWithRedisEnabled()
|
||||||
{
|
{
|
||||||
|
$this->checkRedis();
|
||||||
$this->logInAs('admin');
|
$this->logInAs('admin');
|
||||||
$client = $this->getClient();
|
$client = $this->getClient();
|
||||||
|
|
||||||
|
|
|
@ -54,6 +54,7 @@ class WallabagV2ControllerTest extends WallabagCoreTestCase
|
||||||
|
|
||||||
public function testImportWallabagWithRedisEnabled()
|
public function testImportWallabagWithRedisEnabled()
|
||||||
{
|
{
|
||||||
|
$this->checkRedis();
|
||||||
$this->logInAs('admin');
|
$this->logInAs('admin');
|
||||||
$client = $this->getClient();
|
$client = $this->getClient();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue