123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- <?php
- namespace Predis\Command;
- class StringSetPreserveTest extends PredisCommandTestCase
- {
-
- protected function getExpectedCommand()
- {
- return 'Predis\Command\StringSetPreserve';
- }
-
- protected function getExpectedId()
- {
- return 'SETNX';
- }
-
- public function testFilterArguments()
- {
- $arguments = array('foo', 'bar');
- $expected = array('foo', 'bar');
- $command = $this->getCommand();
- $command->setArguments($arguments);
- $this->assertSame($expected, $command->getArguments());
- }
-
- public function testParseResponse()
- {
- $this->assertTrue($this->getCommand()->parseResponse(1));
- }
-
- public function testSetStringValue()
- {
- $redis = $this->getClient();
- $this->assertTrue($redis->setnx('foo', 'bar'));
- $this->assertFalse($redis->setnx('foo', 'barbar'));
- $this->assertEquals('bar', $redis->get('foo'));
- }
- }
|