Ejemplo n.º 1
0
 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();
 }
Ejemplo n.º 2
0
 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);
 }