public function test_check_login() { $this->session_array['auth_default_password_uid'] = 1; $this->assertEquals(true, $this->object->check_login()); $this->session_array['auth_default_password_uid'] = null; $this->assertEquals(false, $this->object->check_login()); }
public function test_check_login() { $this->session_array['auth_default_facebook_uid'] = 1; $this->session_array['auth_default_facebook_token'] = 12; $this->assertEquals(true, $this->object->check_login()); $this->assertEquals(12, $this->object->access_token); $this->session_array['auth_default_facebook_uid'] = null; $this->assertEquals(false, $this->object->check_login()); }
public function test_login() { $this->assertEquals(true, $this->object->login('Trixie', 'test', true)); $token = $this->pixie->db->query('select')->fields('token')->table('fairies')->execute()->get('token'); $this->assertEquals(true, strlen($token) > 0); $login_token = $this->pixie->cookie->get('login_token'); $this->assertEquals(true, strlen($login_token) > 0); $this->pixie->session->remove('auth_default_password_uid'); $this->pixie->cookie->set('login_token', "Trixie:test"); $this->assertEquals(false, $this->object->check_login()); $this->pixie->cookie->set('login_token', $login_token); $this->assertEquals(true, $this->object->check_login()); $this->pixie->session->remove('auth_default_password_uid'); sleep(2); $this->assertEquals(false, $this->object->check_login()); }