Merge branch 'master' into WebGUI8

This commit is contained in:
Graham Knop 2010-04-13 07:50:02 -05:00
commit 2400f19099
797 changed files with 33894 additions and 27196 deletions

View file

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

View file

@ -23,9 +23,7 @@ use Data::Dumper;
use Test::More; # increment this value for each test you create
use Test::Deep;
my $num_tests = 53;
plan tests => $num_tests;
plan tests => 57;
my $session = WebGUI::Test->session;
@ -401,6 +399,22 @@ is_deeply(
$session->user({userId => 1});
####################################################
#
# ifModifiedSince
#
####################################################
##Clear request object to run a new set of requests
$request = WebGUI::PseudoRequest->new();
$session->{_request} = $request;
$request->headers_in->{'If-Modified-Since'} = '';
ok $session->http->ifModifiedSince(0), 'ifModifiedSince: empty header always returns true';
$request->headers_in->{'If-Modified-Since'} = $session->datetime->epochToHttp(WebGUI::Test->webguiBirthday);
ok $session->http->ifModifiedSince(WebGUI::Test->webguiBirthday + 5), '... epoch check, true';
ok !$session->http->ifModifiedSince(WebGUI::Test->webguiBirthday - 5), '... epoch check, false';
ok $session->http->ifModifiedSince(WebGUI::Test->webguiBirthday - 5, 3600), '... epoch check, made true by maxCacheTimeout';
####################################################
#
# Utility functions
@ -428,7 +442,3 @@ sub deltaHttpTimes {
my $dt2 = $httpParser->parse_datetime($http2);
my $delta_time = $dt1-$dt2;
}
END {
}

View file

@ -111,7 +111,7 @@ is($extras, q!doSomething()!, "drag: set extras");
$icon = $session->icon->delete('','','What did I ever do to you?');
my ($onclick) = linkAndText($icon, 'a', 'onclick');
is($onclick, "return confirm('What did I ever do to you?')", "delete: confirm text");
is($onclick, "return confirm('What did I ever do to you?');", "delete: confirm text");
####################################################
#

View file

@ -15,7 +15,7 @@ use lib "$FindBin::Bin/../lib";
use WebGUI::Test;
use WebGUI::Session;
use Test::More tests => 58; # increment this value for each test you create
use Test::More tests => 62; # increment this value for each test you create
use Test::Deep;
my $session = WebGUI::Test->session;
@ -117,6 +117,16 @@ is($sessionBank[0]->scratch->deleteNameByValue('',''), undef, 'deleteNameByValue
is($sessionBank[3]->scratch->deleteNameByValue('falseValue','0'), 1, 'deleteNameByValue will delete values that are false (0)');
is($sessionBank[2]->scratch->deleteNameByValue('falseValue',''), 1, "deleteNameByValue will delete values that are false ('')");
$scratch->setLanguageOverride('English');
is($scratch->getLanguageOverride, 'English', 'session scratch language is not correctly set');
$scratch->removeLanguageOverride;
is($scratch->getLanguageOverride, undef, 'The session scratch variable language is not removed');
$scratch->setLanguageOverride('myimmaginarylanguagethatisnotinstalled');
is($scratch->getLanguageOverride, undef, 'A non-existing language is set');
$scratch->setLanguageOverride('English');
$scratch->setLanguageOverride();
is($scratch->getLanguageOverride, 'English', 'A empty string is falsely recognised as a language');
END {
$session->scratch->deleteAll;
foreach my $wgSess ($newSession, @sessionBank) {

View file

@ -343,11 +343,11 @@ $session->config->delete('cdn');
#
#######################################
my $escapeString = '10% is enough!';
my $escapeString = '10% is enough;';
my $escapedString = $session->url->escape($escapeString);
my $unEscapedString = $session->url->unescape($escapeString);
is($escapedString, '10%25%20is%20enough!', 'escape method');
is($unEscapedString, '10% is enough!', 'unescape method');
is($escapedString, '10%25%20is%20enough%3B', 'escape method');
is($unEscapedString, '10% is enough;', 'unescape method');
#######################################
#