public function testLogin() { $cnx = new Rserve_Connection(RSERVE_HOST, RSERVE_PORT, array('username' => RSERVE_USER, 'password' => RSERVE_PASS)); // random id $random = ''; for ($i = 0; $i < 10; ++$i) { $random .= dechex(mt_rand()); } $random_id = uniqid($random, TRUE); $r = $cnx->evalString('x="' . $random_id . '"'); $this->assertEquals($r, $random_id); $session = $cnx->detachSession(); }
public function testSession() { $cnx = new Rserve_Connection(RSERVE_HOST); // random id $random = ''; for ($i = 0; $i < 10; ++$i) { $random .= dechex(mt_rand()); } $random_id = uniqid($random, TRUE); $r = $cnx->evalString('x="' . $random_id . '"'); $this->assertEquals($r, $random_id); $session = $cnx->detachSession(); $cnx = new Rserve_Connection($session); $x = $cnx->evalString('x'); $this->assertEquals($x, $random_id); }