Bug 32622: Fix Auth.t on D10
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Fri, 13 Jan 2023 11:15:15 +0000 (12:15 +0100)
committerArthur Suzuki <arthur.suzuki@biblibre.com>
Thu, 26 Jan 2023 09:02:33 +0000 (10:02 +0100)
It's caused by a version mismatch of Test::MockModule with D10,
which does not have this commit: https://github.com/geofffranks/test-mockmodule/commit/fef9e742e45e2437e3449eea9970d70555d44bff

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 d3b4edf009ca7a29341f2dc8a8cebfdc807bad6d)
Signed-off-by: Jacob O'Mara <jacob.omara@ptfs-europe.com>
(cherry picked from commit b36b7d57519a3d471292e47551ace1aef59d7de6)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 3622b51abb082bb009ed6568454ddfff17a3c522)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
t/db_dependent/Auth.t

index 9fe22cb..826aef8 100755 (executable)
@@ -126,9 +126,11 @@ subtest 'checkauth() tests' => sub {
         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' );
 
-        my $mock1 = Test::MockModule->new('C4::Auth')->mock( 'safe_exit', sub {} );
-        my $mock2 = Test::MockModule->new('CGI')     ->mock( 'request_method', 'POST' )
-                                                     ->mock( 'cookie', sub { return $sessionID; } ); # oversimplified..
+        my $mock1 = Test::MockModule->new('C4::Auth');
+        $mock1->mock( 'safe_exit', sub {} );
+        my $mock2 = Test::MockModule->new('CGI');
+        $mock2->mock( 'request_method', 'POST' );
+        $mock2->mock( 'cookie', sub { return $sessionID; } ); # oversimplified..
         my $cgi = CGI->new;
         my $password = 'Incr3d1blyZtr@ng93$';
         $patron2->set_password({ password => $password });