Lines 40-50
subtest 'checkauth() tests' => sub {
Link Here
|
40 |
|
40 |
|
41 |
plan tests => 3; |
41 |
plan tests => 3; |
42 |
|
42 |
|
43 |
my $patron = $builder->build({ source => 'Borrower', value => { flags => undef } })->{userid}; |
43 |
my $patron = $builder->build_object({ class => 'Koha::Patrons', value => { flags => undef } }); |
44 |
|
44 |
|
45 |
# Mock a CGI object with real userid param |
45 |
# Mock a CGI object with real userid param |
46 |
my $cgi = Test::MockObject->new(); |
46 |
my $cgi = Test::MockObject->new(); |
47 |
$cgi->mock( 'param', sub { return $patron; } ); |
47 |
$cgi->mock( |
|
|
48 |
'param', |
49 |
sub { |
50 |
my $var = shift; |
51 |
if ( $var eq 'userid' ) { return $patron->userid; } |
52 |
} |
53 |
); |
48 |
$cgi->mock( 'cookie', sub { return; } ); |
54 |
$cgi->mock( 'cookie', sub { return; } ); |
49 |
|
55 |
|
50 |
my $authnotrequired = 1; |
56 |
my $authnotrequired = 1; |
51 |
- |
|
|