Skip to content

Commit 9629fa0

Browse files
[VarDumper] fix tests
1 parent af1b2cc commit 9629fa0

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/Symfony/Component/VarDumper/Tests/Caster/RedisCasterTest.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,24 +46,26 @@ public function testNotConnected()
4646

4747
public function testConnected()
4848
{
49+
$redisHost = getenv('REDIS_HOST');
4950
$redis = new \Redis();
50-
if (!@$redis->connect('127.0.0.1')) {
51-
$e = error_get_last();
52-
self::markTestSkipped($e['message']);
51+
try {
52+
$redis->connect($redisHost);
53+
} catch (\Exception $e) {
54+
self::markTestSkipped($e->getMessage());
5355
}
5456

5557
if (\defined('HHVM_VERSION_ID')) {
5658
$xCast = <<<'EODUMP'
5759
Redis {
58-
#host: "127.0.0.1"
60+
#host: "$redisHost"
5961
%A
6062
}
6163
EODUMP;
6264
} else {
6365
$xCast = <<<'EODUMP'
6466
Redis {%A
6567
isConnected: true
66-
host: "127.0.0.1"
68+
host: "$redisHost"
6769
port: 6379
6870
auth: null
6971
dbNum: 0

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy