public function testGC() { $this->rediska->set('s_123', 'aaa'); $this->rediska->addToSet('s_sessions', '123'); $reply = $this->saveHandler->gc(0); $this->assertTrue($reply); $values = $this->rediska->getSet('s_sessions'); $this->assertEquals(array('123'), $values); $value = $this->rediska->get('s_123'); $this->assertEquals('aaa', $value); $this->rediska->delete('s_123'); $reply = $this->saveHandler->gc(0); $this->assertTrue($reply); $values = $this->rediska->getSet('s_sessions'); $this->assertEquals(array(), $values); }
public function testIteration() { $values = array(123, 456, 789); foreach ($values as $value) { $this->rediska->addToSet('test', $value); } $count = 0; foreach ($this->set as $value) { $this->assertTrue(in_array($value, $values)); $count++; } $this->assertEquals(3, $count); }