Exemplo n.º 1
0
 public function testUpdate()
 {
     $fdao = new SessionsDao();
     $session = new Session();
     $session->sid = "testsid";
     $session->username = "******";
     $fdao->save($file);
     $res = $fdao->getBySid("testsid");
     $this->assertGreaterThan(0, $res);
     $dsession = $res[0];
     $dsession->username = "******";
     $fdao->save($dsession);
     $msession = $fdao->getById($dsession->id)[0];
     $this->assertEquals("changedname", $msession->username);
 }
Exemplo n.º 2
0
function persistLogboostSession($logboostSession)
{
    $sess = new Session();
    $sess->username = $logboostSession->username;
    $sess->ip = $logboostSession->ip;
    $sess->date = $logboostSession->date;
    $sess->validuntil = $logboostSession->validuntil;
    $sess->plan = $logboostSession->plan;
    $sdao = new SessionsDao();
    $sdao->save($sess);
}