diff --git a/t/db_dependent/api/v1/two_factor_auth.t b/t/db_dependent/api/v1/two_factor_auth.t index ddb9178e3a..175e6e9529 100755 --- a/t/db_dependent/api/v1/two_factor_auth.t +++ b/t/db_dependent/api/v1/two_factor_auth.t @@ -90,7 +90,19 @@ subtest 'registration and verification' => sub { $tx = $t->ua->build_tx( POST => "/api/v1/auth/two-factor/registration" ); $tx->req->cookies( { name => 'CGISESSID', value => $session->id } ); $tx->req->env( { REMOTE_ADDR => $remote_address } ); - $t->request_ok($tx)->status_is(201); + { + # Ignore the following warning + # Use of uninitialized value $aMask[1383] in bitwise xor (^) at /usr/local/share/perl/5.36.0/GD/Barcode/QRcode.pm line 217. + # We do not want to expect it (using Test::Warn): it is a bug from GD::Barcode + local $SIG{__WARN__} = sub { }; + my $dup_err; + local *STDERR; + open STDERR, ">>", \$dup_err; + + $t->request_ok($tx)->status_is(201); + + close STDERR; + } my $secret32 = $t->tx->res->json->{secret32}; $tx = $t->ua->build_tx( POST => "/api/v1/auth/two-factor/registration/verification" ); @@ -120,7 +132,19 @@ subtest 'registration and verification' => sub { $tx = $t->ua->build_tx( POST => "/api/v1/auth/two-factor/registration" ); $tx->req->cookies( { name => 'CGISESSID', value => $session->id } ); $tx->req->env( { REMOTE_ADDR => $remote_address } ); - $t->request_ok($tx)->status_is(201); + { + # Ignore the following warning + # Use of uninitialized value $aMask[1383] in bitwise xor (^) at /usr/local/share/perl/5.36.0/GD/Barcode/QRcode.pm line 217. + # We do not want to expect it (using Test::Warn): it is a bug from GD::Barcode + local $SIG{__WARN__} = sub { }; + my $dup_err; + local *STDERR; + open STDERR, ">>", \$dup_err; + + $t->request_ok($tx)->status_is(201); + + close STDERR; + } $secret32 = $t->tx->res->json->{secret32}; $auth = Koha::Auth::TwoFactorAuth->new( { patron => $patron, secret32 => $secret32 } );