switchAdminOn/Off no longer exists
This commit is contained in:
parent
954d74b88e
commit
1e9837365d
1 changed files with 6 additions and 7 deletions
13
t/Session.t
13
t/Session.t
|
|
@ -62,12 +62,11 @@ isa_ok($slave2, 'WebGUI::SQL::db');
|
||||||
|
|
||||||
cmp_ok($session->get("lastPageView"), '>', 0, "lastPageView set to something");
|
cmp_ok($session->get("lastPageView"), '>', 0, "lastPageView set to something");
|
||||||
|
|
||||||
can_ok($session, qw/isAdminOn switchAdminOn switchAdminOff/);
|
can_ok($session, qw/isAdminOn/);
|
||||||
is($session->isAdminOn, 0, "isAdminOn()");
|
$session->user({userId => 3});
|
||||||
$session->switchAdminOn;
|
is($session->isAdminOn, 1, "admin has admin on");
|
||||||
is($session->isAdminOn, 1, "switchAdminOn()");
|
$session->user({userId => 1});
|
||||||
$session->switchAdminOff;
|
is($session->isAdminOn, 0, "visitor has admin off");
|
||||||
is($session->isAdminOn, 0, "switchAdminOff()");
|
|
||||||
|
|
||||||
my $token = $session->scratch->get('webguiCsrfToken');
|
my $token = $session->scratch->get('webguiCsrfToken');
|
||||||
ok( $token, 'CSRF token set');
|
ok( $token, 'CSRF token set');
|
||||||
|
|
@ -139,7 +138,7 @@ ok($count == 0,"end() removes current entry from database");
|
||||||
{
|
{
|
||||||
my $expire = WebGUI::Session->open($session->config);
|
my $expire = WebGUI::Session->open($session->config);
|
||||||
my $guard = WebGUI::Test->cleanupGuard($expire);
|
my $guard = WebGUI::Test->cleanupGuard($expire);
|
||||||
$expire->switchAdminOn;
|
$expire->user({ userId => 3 });
|
||||||
# jury rig the database and the cache to expire
|
# jury rig the database and the cache to expire
|
||||||
my $expire_time = $expire->get('lastPageView') - 1;
|
my $expire_time = $expire->get('lastPageView') - 1;
|
||||||
$session->db->write("update userSession set userId=?, expires=? where sessionId=?", [3, $expire_time, $expire->getId]);
|
$session->db->write("update userSession set userId=?, expires=? where sessionId=?", [3, $expire_time, $expire->getId]);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue