lots of test fixes
This commit is contained in:
parent
0d311117e2
commit
30657d61f7
21 changed files with 75 additions and 87 deletions
|
|
@ -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__; }
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue