コード例 #1
0
ファイル: CredisTest.php プロジェクト: colinmollenhour/credis
 public function testTransaction()
 {
     $reply = $this->credis->multi()->incr('foo')->incr('bar')->exec();
     $this->assertEquals(array(1, 1), $reply);
     $reply = $this->credis->pipeline()->multi()->incr('foo')->incr('bar')->exec();
     $this->assertEquals(array(2, 2), $reply);
     $reply = $this->credis->multi()->pipeline()->incr('foo')->incr('bar')->exec();
     $this->assertEquals(array(3, 3), $reply);
     $reply = $this->credis->multi()->set('a', 3)->lpop('a')->exec();
     $this->assertEquals(2, count($reply));
     $this->assertEquals(TRUE, $reply[0]);
     $this->assertFalse($reply[1]);
 }