Skip to content

Commit

Permalink
Add fallback for older PHPUnit versions
Browse files Browse the repository at this point in the history
  • Loading branch information
kelunik committed Jul 27, 2020
1 parent a867540 commit 9f97342
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion test/AuthTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,12 @@ public function testFailure(): \Generator
$redis = new Redis(new RemoteExecutor(Config::fromUri('tcp://127.0.0.1:25325?password=wrong')));

$this->expectException(QueryException::class);
$this->expectExceptionMessageMatches('(ERR invalid password|WRONGPASS invalid username-password pair)');

if (\method_exists($this, 'expectExceptionMessageMatches')) {
$this->expectExceptionMessageMatches('(ERR invalid password|WRONGPASS invalid username-password pair)');
} else {
$this->expectExceptionMessageRegExp('(ERR invalid password|WRONGPASS invalid username-password pair)');
}

yield $redis->echo('PONG');
}
Expand Down

0 comments on commit 9f97342

Please sign in to comment.