Bug 32622: Fix Auth.t on D10

It's caused by a version mismatch of Test::MockModule with D10,
which does not have this commit: fef9e742e4

We should remove the chaining here.

Test plan:
Confirm that Auth.t still pass, and is fixed on D10

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit d3b4edf009)
Signed-off-by: Jacob O'Mara <jacob.omara@ptfs-europe.com>
This commit is contained in:
Jonathan Druart 2023-01-13 12:15:15 +01:00 committed by Jacob O'Mara
parent b7ecfa0138
commit b36b7d5751

View file

@ -171,9 +171,11 @@ subtest 'checkauth() tests' => sub {
my ( $return ) = C4::Auth::check_cookie_auth( $sessionID, undef, { skip_version_check => 1, remote_addr => '1.2.3.4' } ); my ( $return ) = C4::Auth::check_cookie_auth( $sessionID, undef, { skip_version_check => 1, remote_addr => '1.2.3.4' } );
is( $return, 'ok', 'Former session in shape now' ); is( $return, 'ok', 'Former session in shape now' );
my $mock1 = Test::MockModule->new('C4::Auth')->mock( 'safe_exit', sub {} ); my $mock1 = Test::MockModule->new('C4::Auth');
my $mock2 = Test::MockModule->new('CGI') ->mock( 'request_method', 'POST' ) $mock1->mock( 'safe_exit', sub {} );
->mock( 'cookie', sub { return $sessionID; } ); # oversimplified.. my $mock2 = Test::MockModule->new('CGI');
$mock2->mock( 'request_method', 'POST' );
$mock2->mock( 'cookie', sub { return $sessionID; } ); # oversimplified..
my $cgi = CGI->new; my $cgi = CGI->new;
my $password = 'Incr3d1blyZtr@ng93$'; my $password = 'Incr3d1blyZtr@ng93$';
$patron2->set_password({ password => $password }); $patron2->set_password({ password => $password });