removing first parameter from WebGUI::Session->open and other cleanups

This commit is contained in:
Graham Knop 2010-02-23 16:16:09 -06:00
parent 29df110409
commit a141de0ebf
39 changed files with 150 additions and 291 deletions

View file

@ -27,7 +27,7 @@ is( ref $config->get("macros"), "HASH", "get() macros hash" );
is( ref $config->get("assets"), "HASH", "get() assets hash" );
is( ref $config->get("shippingDrivers"), "ARRAY", "get() shippingDrivers array" );
is( $config->getFilename, basename($configFile), "getFilename()" );
ok( defined WebGUI::Config->readAllConfigs($webguiRoot), "readAllConfigs" );
ok( defined WebGUI::Config->readAllConfigs, "readAllConfigs" );
$config->addToArray("shippingDrivers","TEST");
my $found = 0;
foreach my $driver ( @{$config->get("shippingDrivers")}) {

View file

@ -540,7 +540,7 @@ my @sessionBank = ();
foreach my $idx (0..$#scratchTests) {
##Create a new session
$sessionBank[$idx] = WebGUI::Session->open(WebGUI::Test->root, WebGUI::Test->file);
$sessionBank[$idx] = WebGUI::Session->open(WebGUI::Test->file);
##Create a new user and make this session's default user that user
$itchies[$idx] = WebGUI::User->new($sessionBank[$idx], "new");
@ -587,7 +587,7 @@ foreach my $idx (0..$#ipTests) {
$ENV{REMOTE_ADDR} = $ip;
##Create a new session
$sessionBank[$idx] = WebGUI::Session->open(WebGUI::Test->root, WebGUI::Test->file);
$sessionBank[$idx] = WebGUI::Session->open(WebGUI::Test->file);
##Create a new user and make this session's default user that user
$tcps[$idx] = WebGUI::User->new($sessionBank[$idx], "new");

View file

@ -178,7 +178,7 @@ sub setupUsers {
# Create sessions such that users are added to the userSession table
foreach (@users) {
my $newSession = WebGUI::Session->open(WebGUI::Test::root, WebGUI::Test::file);
my $newSession = WebGUI::Session->open(WebGUI::Test::file);
$newSession->user({user => $_});
}
addToCleanup(@users);

View file

@ -225,8 +225,8 @@ my $showDebug = $eh->showDebug;
#
####################################################
my $newSession = WebGUI::Session->open(WebGUI::Test::root, WebGUI::Test::file);
WebGUI::Test->sessionsToDelete($newSession);
my $newSession = WebGUI::Session->open(WebGUI::Test::file);
addToCleanup($newSession);
my $outputBuffer;
open my $outputHandle, '>', \$outputBuffer or die "Unable to create scalar filehandle: $!\n";
$newSession->output->setHandle($outputHandle);

View file

@ -54,7 +54,7 @@ for (my $count = 1; $count <= $maxCount; $count++){
}
##Creating a new session with the previous session's Id should clone the scratch data
my $newSession = WebGUI::Session->open(WebGUI::Test->root, WebGUI::Test->file, undef, undef, $session->getId);
my $newSession = WebGUI::Session->open(WebGUI::Test->file, undef, undef, $session->getId);
is($newSession->getId, $session->getId, "Successful session duplication");
@ -81,7 +81,7 @@ is($scratch->set('','value'), undef, 'set returns undef unless it gets a name ev
#
############################################
my @sessionBank = map { WebGUI::Session->open(WebGUI::Test->root, WebGUI::Test->file) } 0..3;
my @sessionBank = map { WebGUI::Session->open(WebGUI::Test->file) } 0..3;
##Set variables to be deleted by name
foreach my $i (0..3) {

View file

@ -133,8 +133,8 @@ is( $cart->readyForCheckout, 0, 'Cannot checkout an empty cart' );
is($session->db->quickScalar("select count(*) from cartItem where cartId=?",[ $cart->getId ]), 0, "Items are removed from cart.");
my $session2 = WebGUI::Session->open(WebGUI::Test->root, WebGUI::Test->file);
WebGUI::Test->sessionsToDelete($session2);
my $session2 = WebGUI::Session->open(WebGUI::Test->file);
addToCleanup($session2);
$session2->user({userId => 3});
my $cart2 = WebGUI::Shop::Cart->newBySession($session2);
isnt(

View file

@ -80,7 +80,7 @@ is($user->status, "Selfdestructed", 'status("Selfdestructed")');
# Deactivation user deletes all sessions and scratches
my $newSession = WebGUI::Session->open( WebGUI::Test->root, WebGUI::Test->file );
my $newSession = WebGUI::Session->open( WebGUI::Test->file );
$newSession->user({ user => $user });
$newSession->scratch->set("hasStapler" => "no");

View file

@ -214,7 +214,7 @@ is($siteWideTag->getId(), $siteWideTagId, 'versionTagMode siteWide: reclaim site
## Through in a new session as different user
my $admin_session = WebGUI::Session->open($WebGUI::Test::WEBGUI_ROOT, $WebGUI::Test::CONFIG_FILE);
my $admin_session = WebGUI::Session->open($WebGUI::Test->file);
$admin_session->user({'userId' => 3});
WebGUI::Test->sessionsToDelete($admin_session);
@ -279,8 +279,8 @@ $adminUserTag->rollback();
is($tag->getAssetCount, 1, qq{$test_prefix [singlePerUser] tag with 1 asset});
# create admin session
my $admin_session = WebGUI::Session->open($WebGUI::Test::WEBGUI_ROOT, $WebGUI::Test::CONFIG_FILE);
WebGUI::Test->sessionsToDelete($admin_session);
my $admin_session = WebGUI::Session->open($WebGUI::Test->file);
addToCleanup($session);
$admin_session->user({'userId' => 3});
setUserVersionTagMode($admin_session->user(), q{autoCommit});
@ -331,8 +331,8 @@ $adminUserTag->rollback();
is($tag->getAssetCount, 1, qq{$test_prefix [siteWide] tag with 1 asset});
# create admin session
$admin_session = WebGUI::Session->open($WebGUI::Test::WEBGUI_ROOT, $WebGUI::Test::CONFIG_FILE);
WebGUI::Test->sessionsToDelete($admin_session);
$admin_session = WebGUI::Session->open(WebGUI::Test->file);
addToCleanup($admin_session);
$admin_session->user({'userId' => 3});
setUserVersionTagMode($admin_session->user(), q{autoCommit});

View file

@ -58,14 +58,14 @@ note $scratchCount;
my @sessions;
foreach (1..2) {
push @sessions, WebGUI::Session->open(WebGUI::Test->root, WebGUI::Test->file);
push @sessions, WebGUI::Session->open(WebGUI::Test->file);
}
##Force automatic expiration of the sessions
$session->setting->set('sessionTimeout', -500);
foreach (1..2) {
push @sessions, WebGUI::Session->open(WebGUI::Test->root, WebGUI::Test->file);
push @sessions, WebGUI::Session->open(WebGUI::Test->file);
}
$session->setting->set('sessionTimeout', $origSessionTimeout );

View file

@ -37,8 +37,8 @@ WebGUI::Test->tagsToRollback($tag);
my $cart1 = WebGUI::Shop::Cart->create($session);
my $session2 = WebGUI::Session->open(WebGUI::Test->root, WebGUI::Test->file);
WebGUI::Test->sessionsToDelete($session2);
my $session2 = WebGUI::Session->open(WebGUI::Test->file);
addToCleanup($session2);
my $cart2 = WebGUI::Shop::Cart->create($session2);
$cart2->update({creationDate => time()-10000});