123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- <?php
- namespace Predis\Command;
- class TransactionUnwatchTest extends PredisCommandTestCase
- {
-
- protected function getExpectedCommand()
- {
- return 'Predis\Command\TransactionUnwatch';
- }
-
- protected function getExpectedId()
- {
- return 'UNWATCH';
- }
-
- public function testFilterArguments()
- {
- $command = $this->getCommand();
- $command->setArguments(array());
- $this->assertSame(array(), $command->getArguments());
- }
-
- public function testParseResponse()
- {
- $this->assertSame('OK', $this->getCommand()->parseResponse('OK'));
- }
-
- public function testUnwatchWatchedKeys()
- {
- $redis1 = $this->getClient();
- $redis2 = $this->getClient();
- $redis1->set('foo', 'bar');
- $redis1->watch('foo');
- $this->assertEquals('OK', $redis1->unwatch());
- $redis1->multi();
- $redis1->get('foo');
- $redis2->set('foo', 'hijacked');
- $this->assertSame(array('hijacked'), $redis1->exec());
- }
-
- public function testCanBeCalledInsideTransaction()
- {
- $redis = $this->getClient();
- $redis->multi();
- $this->assertInstanceOf('Predis\Response\Status', $redis->unwatch());
- }
- }
|