Tests for Predis\RedisServerProfile.

This commit is contained in:
Daniele Alessandri
2010-03-10 14:04:43 +01:00
parent 95664719a6
commit ea9f83d4c0
2 changed files with 71 additions and 0 deletions
+12
View File
@@ -108,6 +108,18 @@ class RC {
$testcaseInstance->assertEquals($expectedMessage, $thrownException->getMessage());
}
public static function testForClientException($testcaseInstance, $expectedMessage, $wrapFunction) {
$thrownException = null;
try {
$wrapFunction($testcaseInstance);
}
catch (Predis\ClientException $exception) {
$thrownException = $exception;
}
$testcaseInstance->assertType('Predis\ClientException', $thrownException);
$testcaseInstance->assertEquals($expectedMessage, $thrownException->getMessage());
}
public static function pushTailAndReturn(Predis\Client $client, $keyName, Array $values, $wipeOut = 0) {
if ($wipeOut == true) {
$client->delete($keyName);