Merge commit '4635b91554' into WebGUI8. Syntax clean up to 7.10.2

This commit is contained in:
Colin Kuskie 2010-10-27 15:59:33 -07:00
commit 87326192a3
46 changed files with 956 additions and 969 deletions

View file

@ -43,7 +43,26 @@ my $createAccountSession = WebGUI::Test->newSession(0, {
$auth = WebGUI::Auth->new( $createAccountSession, $AUTH_METHOD );
my $username = $createAccountSession->id->generate;
push @cleanupUsernames, $username;
$output = $auth->createAccountSave( $username, { }, "PASSWORD" );
$output = $auth->createAccountSave( $username, { }, "PASSWORD" );
WebGUI::Test->addToCleanup(sub {
for my $username ( @cleanupUsernames ) {
# We don't create actual, real users, so we have to cleanup by hand
my $userId = $session->db->quickScalar(
"SELECT userId FROM users WHERE username=?",
[ $username ]
);
my @tableList
= qw{authentication users userProfileData groupings inbox userLoginLog};
for my $table ( @tableList ) {
$session->db->write(
"DELETE FROM $table WHERE userId=?",
[ $userId ]
);
}
}
});
is(
$createAccountSession->http->getRedirectLocation, 'REDIRECT_URL',
@ -70,24 +89,3 @@ is(
);
is $output, undef, 'login returns undef when showMessageOnLogin is false';
#----------------------------------------------------------------------------
# Cleanup
END {
for my $username ( @cleanupUsernames ) {
# We don't create actual, real users, so we have to cleanup by hand
my $userId = $session->db->quickScalar(
"SELECT userId FROM users WHERE username=?",
[ $username ]
);
my @tableList
= qw{authentication users userProfileData groupings inbox userLoginLog};
for my $table ( @tableList ) {
$session->db->write(
"DELETE FROM $table WHERE userId=?",
[ $userId ]
);
}
}
}