// "AGPLv3". If not, see <http://www.gnu.org/licenses/>. // // Authors: // Loic Dachary <*****@*****.**> // Morgan Manach <*****@*****.**> // require_once 'constants.php'; require_once 'lib_filters.php'; require_once 'poker.php'; $hci_header_showed = false; function hci_header() { require_once _cst_header; } function hci_footer() { require_once _cst_footer; } function no_auth_handler($name, $referer) { header('Location: login.php?name=' . $name . '&referer=' . urlencode($referer)); die; } try { $poker = new poker(_cst_poker_soap_host); } catch (Exception $e) { print "<h3>" . $e->getMessage() . "</h3d>"; die; } $poker->setNoAuthHandler('no_auth_handler'); $poker->setTimeoutCookie(_cst_timeout_cookie);
public function test12_serial_changed() { $poker = new poker('fakehost'); $poker->setNoAuthHandler('auth_handler'); $poker->login('user', 'password'); $this->assertNotEquals(false, $poker->isLoggedIn()); $_GET['serial'] = 4242; $_GET['name'] = 'user'; $poker->getPersonalInfo(); unset($_GET['serial']); unset($_GET['name']); $this->assertEquals(true, isset($GLOBALS['auth_handler_called'])); $this->assertEquals('user', $GLOBALS['auth_handler_called']['name']); }