Skip to content

Commit

Permalink
Fixed RedisClient::__set() [Fixes #12]
Browse files Browse the repository at this point in the history
  • Loading branch information
fprochazka committed Jul 25, 2013
1 parent 23cc205 commit ecb3865
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Kdyby/Redis/RedisClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@ public function &__get($name)
*/
public function __set($name, $value)
{
return $this->send('set', array($value));
return $this->send('set', array($name, $value));
}


Expand Down
12 changes: 12 additions & 0 deletions tests/KdybyTests/Redis/RedisClient.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,18 @@ class RedisClientTest extends AbstractRedisTestCase
}, 'Kdyby\Redis\TransactionException');
}



public function testMagicAccessors()
{
Assert::false(isset($this->client->nemam));
$this->client->nemam = "nemam";
Assert::true(isset($this->client->nemam));
Assert::same("nemam", $this->client->nemam);
unset($this->client->nemam);
Assert::false(isset($this->client->nemam));
}

}

\run(new RedisClientTest());

0 comments on commit ecb3865

Please sign in to comment.