Skip to content

Commit d3524b1

Browse files
committed
Using auth when testing.
1 parent 4981336 commit d3524b1

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

tests/TestRedis.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ class Redis_Test extends PHPUnit_Framework_TestCase
77
{
88
const HOST = '127.0.0.1';
99
const PORT = 6379;
10+
const AUTH = 'password';
11+
1012
/**
1113
* @var Redis
1214
*/
@@ -20,7 +22,9 @@ public function setUp()
2022
private function newInstance() {
2123
$r = new Redis();
2224
$r->connect(self::HOST, self::PORT);
23-
25+
if(self::AUTH) {
26+
$r->auth(self::AUTH);
27+
}
2428
// uncomment the following if you want to use authentication
2529
// $this->assertTrue($r->auth('foobared'));
2630

@@ -534,6 +538,9 @@ public function testblockingPop() {
534538
sleep(2);
535539
$r = new Redis;
536540
$r->connect("'.self::HOST.'", '.self::PORT.');
541+
if('.self::AUTH.') {
542+
$r->auth('.self::AUTH.');
543+
}
537544
$r->lPush($_ENV["PHPREDIS_key"], $_ENV["PHPREDIS_value"]);
538545
?>');
539546
fclose($pipes[0]);

0 commit comments

Comments
 (0)