Skip to content

Commit aa6382b

Browse files
NaktibaldaDavertMik
authored andcommitted
Mark Redis tests as skipped if Redis server is not accessible (#3468)
1 parent 2183dff commit aa6382b

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

tests/unit/Codeception/Module/RedisTest.php

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,16 @@ protected function setUp()
5959
}
6060
/** @var ModuleContainer $container */
6161
$container = make_container();
62-
$this->module = new Redis($container);
63-
$this->module->_setConfig(self::$config);
64-
$this->module->_initialize();
65-
66-
$this->module->driver->flushDb();
62+
63+
try {
64+
$this->module = new Redis($container);
65+
$this->module->_setConfig(self::$config);
66+
$this->module->_initialize();
67+
68+
$this->module->driver->flushDb();
69+
} catch (Predis\Connection\ConnectionException $e) {
70+
$this->markTestSkipped($e->getMessage());
71+
}
6772

6873
$addMethods = [
6974
'string' => 'set',

0 commit comments

Comments
 (0)