Bug 31247: Add tests
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Wed, 27 Jul 2022 15:52:34 +0000 (17:52 +0200)
committerTomas Cohen Arazi <tomascohen@theke.io>
Fri, 29 Jul 2022 18:41:05 +0000 (15:41 -0300)
Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
t/db_dependent/Auth.t

index ed1973e..58f64ce 100755 (executable)
@@ -193,6 +193,11 @@ subtest 'checkauth() tests' => sub {
         is( $userid, $patron->userid, 'Succesful login' );
         is( C4::Auth::get_session($sessionID)->param('waiting-for-2FA'), 0, 'Second auth no longer required if OTP token has been verified' );
 
+        logout($cgi);
+        ( $userid, $cookie, $sessionID, $flags ) = C4::Auth::checkauth( $cgi, 'authrequired', undef, 'opac' );
+        is( $userid, $patron->userid, 'Succesful login at the OPAC' );
+        is( C4::Auth::get_session($sessionID)->param('waiting-for-2FA'), undef, 'No second auth required at the OPAC' );
+
         t::lib::Mocks::mock_preference( 'TwoFactorAuthentication', 0 );
     };