lots of test fixes

This commit is contained in:
Graham Knop 2010-06-13 06:19:41 -05:00
parent 0d311117e2
commit 30657d61f7
21 changed files with 75 additions and 87 deletions

View file

@ -184,17 +184,10 @@ sub testCount {
plan tests => testCount() ;
my $output;
foreach my $testSet (@testArray) {
$output = FAKE_ENV->new( $testSet->{agent},
$testSet->{address} || '69.42.78.32')
->requestNotViewed();
$session->request->env->{HTTP_USER_AGENT} = $testSet->{agent};
$session->request->env->{REMOTE_ADDR} = $testSet->{address} || '69.42.78.32';
my $output = $session->env->requestNotViewed;
is($output, $testSet->{output}, $testSet->{comment});
}
{ # this is a local fake of the session, used for testing only
package FAKE_ENV;
use base 'WebGUI::Session::Env';
sub new { shift; return bless { _env => { HTTP_USER_AGENT => $_[0], REMOTE_ADDR => $_[1] } }, __PACKAGE__; }
}