mirror of
https://github.com/predis/predis.git
synced 2026-10-07 20:38:06 +00:00
Rewrite parts of Predis\Transaction\MultiExec to make them less ugly.
We also changed some options for this class, the accepted ones are:
- "keys": string or array of strings for automatic WATCH.
- "cas": sets the check-and-set mode.
- "retry": number of attempts before giving up aborted transactions.
- "exceptions": sets whether exceptions should be thrown on error
responses (overrides the "exceptions" client option).
The "on_retry" option has been removed.
This commit is contained in:
@@ -666,6 +666,7 @@ class ClientTest extends StandardTestCase
|
||||
|
||||
/**
|
||||
* @group disconnected
|
||||
* @todo I hate this test but reflection is the easiest way in this case.
|
||||
*/
|
||||
public function testTransactionWithArrayReturnsTransactionMultiExecWithOptions()
|
||||
{
|
||||
@@ -675,10 +676,13 @@ class ClientTest extends StandardTestCase
|
||||
|
||||
$this->assertInstanceOf('Predis\Transaction\MultiExec', $tx = $client->transaction($options));
|
||||
|
||||
$reflection = new \ReflectionProperty($tx, 'options');
|
||||
$reflection->setAccessible(true);
|
||||
$property = new \ReflectionProperty($tx, 'modeCAS');
|
||||
$property->setAccessible(true);
|
||||
$this->assertSame($options['cas'], $property->getValue($tx));
|
||||
|
||||
$this->assertSame($options, $reflection->getValue($tx));
|
||||
$property = new \ReflectionProperty($tx, 'attempts');
|
||||
$property->setAccessible(true);
|
||||
$this->assertSame($options['retry'], $property->getValue($tx));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user