diff --git a/t/db_dependent/Koha/Patron.t b/t/db_dependent/Koha/Patron.t index de3bfe856e..24c0389c77 100755 --- a/t/db_dependent/Koha/Patron.t +++ b/t/db_dependent/Koha/Patron.t @@ -742,6 +742,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' );