Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a0d601a

Browse files
committed
RedisTest::testPipelineMultiExec
1 parent aa95fcb commit a0d601a

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

tests/RedisTest.php

+17
Original file line numberDiff line numberDiff line change
@@ -2487,6 +2487,23 @@ public function testPipeline() {
24872487
$this->redis->setOption(Redis::OPT_PREFIX, "");
24882488
}
24892489

2490+
public function testPipelineMultiExec()
2491+
{
2492+
if (!$this->havePipeline()) {
2493+
$this->markTestSkipped();
2494+
}
2495+
2496+
$ret = $this->redis->pipeline()
2497+
->ping()
2498+
->multi()->set('x', 42)->incr('x')->exec()
2499+
->ping()
2500+
->multi()->get('x')->del('x')->exec()
2501+
->ping()
2502+
->exec();
2503+
$this->assertTrue(is_array($ret));
2504+
$this->assertEquals(5, count($ret)); // should be 5 atomic operations
2505+
}
2506+
24902507
protected function sequence($mode) {
24912508
$ret = $this->redis->multi($mode)
24922509
->set('x', 42)

0 commit comments

Comments
 (0)