diff --git a/t/db_dependent/Koha/Patron.t b/t/db_dependent/Koha/Patron.t index be991cb43a..4f824aa782 100755 --- a/t/db_dependent/Koha/Patron.t +++ b/t/db_dependent/Koha/Patron.t @@ -739,6 +739,8 @@ subtest 'to_api() tests' => sub { } ); + t::lib::Mocks::mock_userenv( { patron => $consumer } ); + my $restricted = $patron->to_api( { user => $consumer } )->{restricted}; ok( defined $restricted, 'restricted is defined' ); ok( !$restricted, 'debarred is undef, restricted evaluates to false' );