Bug 31391: Implement UseRecalls choices in tests
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
This commit is contained in:
parent
6091466f51
commit
b9b80b9471
|
|
@ -1911,7 +1911,7 @@ subtest "CanBookBeRenewed tests" => sub {
|
|||
t::lib::Mocks::mock_preference( 'FineNoRenewals', 0 );
|
||||
|
||||
# Recalls
|
||||
t::lib::Mocks::mock_preference( 'UseRecalls', 1 );
|
||||
t::lib::Mocks::mock_preference( 'UseRecalls', 'opac' );
|
||||
Koha::CirculationRules->set_rules(
|
||||
{
|
||||
categorycode => undef,
|
||||
|
|
@ -2877,7 +2877,7 @@ subtest 'AddIssue & AllowReturnToBranch' => sub {
|
|||
subtest 'AddIssue | recalls' => sub {
|
||||
plan tests => 3;
|
||||
|
||||
t::lib::Mocks::mock_preference( "UseRecalls", 1 );
|
||||
t::lib::Mocks::mock_preference( "UseRecalls", 'opac' );
|
||||
t::lib::Mocks::mock_preference( "item-level_itypes", 1 );
|
||||
my $patron1 = $builder->build_object( { class => 'Koha::Patrons' } );
|
||||
my $patron2 = $builder->build_object( { class => 'Koha::Patrons' } );
|
||||
|
|
@ -5691,7 +5691,7 @@ subtest 'CanBookBeIssued | notforloan' => sub {
|
|||
subtest 'CanBookBeIssued | recalls' => sub {
|
||||
plan tests => 3;
|
||||
|
||||
t::lib::Mocks::mock_preference( "UseRecalls", 1 );
|
||||
t::lib::Mocks::mock_preference( "UseRecalls", 'opac' );
|
||||
t::lib::Mocks::mock_preference( "item-level_itypes", 1 );
|
||||
my $patron1 = $builder->build_object( { class => 'Koha::Patrons' } );
|
||||
my $patron2 = $builder->build_object( { class => 'Koha::Patrons' } );
|
||||
|
|
@ -5900,7 +5900,7 @@ subtest 'AddReturn should clear items.onloan for unissued items' => sub {
|
|||
subtest 'AddReturn | recalls' => sub {
|
||||
plan tests => 3;
|
||||
|
||||
t::lib::Mocks::mock_preference( "UseRecalls", 1 );
|
||||
t::lib::Mocks::mock_preference( "UseRecalls", 'opac' );
|
||||
t::lib::Mocks::mock_preference( "item-level_itypes", 1 );
|
||||
my $patron1 = $builder->build_object( { class => 'Koha::Patrons' } );
|
||||
my $patron2 = $builder->build_object( { class => 'Koha::Patrons' } );
|
||||
|
|
|
|||
|
|
@ -168,7 +168,7 @@ subtest 'transfer already at destination' => sub {
|
|||
is( $messages->{ResFound}->{itemnumber}, $item->itemnumber, "We got the reserve info" );
|
||||
|
||||
# recalls
|
||||
t::lib::Mocks::mock_preference( 'UseRecalls', 1 );
|
||||
t::lib::Mocks::mock_preference( 'UseRecalls', 'opac' );
|
||||
my $recall = Koha::Recall->new(
|
||||
{
|
||||
biblio_id => $item->biblionumber,
|
||||
|
|
|
|||
|
|
@ -1871,10 +1871,10 @@ subtest 'Recalls tests' => sub {
|
|||
is( $recalls->count, 3, 'Correctly get number of recalls for biblio' );
|
||||
is( $recalls->filter_by_current->count, 1, 'Correctly get number of active recalls for biblio' );
|
||||
|
||||
t::lib::Mocks::mock_preference( 'UseRecalls', 0 );
|
||||
t::lib::Mocks::mock_preference( "UseRecalls", "off" );
|
||||
is( $biblio->can_be_recalled( { patron => $patron1 } ), 0, "Can't recall with UseRecalls disabled" );
|
||||
|
||||
t::lib::Mocks::mock_preference( "UseRecalls", 1 );
|
||||
t::lib::Mocks::mock_preference( "UseRecalls", "opac" );
|
||||
$item1->update( { notforloan => 1 } );
|
||||
is( $biblio->can_be_recalled( { patron => $patron1 } ), 0, "Can't recall with no available items" );
|
||||
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ subtest '_status() tests' => sub {
|
|||
my $library = $builder->build_object( { class => 'Koha::Libraries' } );
|
||||
t::lib::Mocks::mock_userenv( { branchcode => $library->branchcode } );
|
||||
|
||||
t::lib::Mocks::mock_preference( 'UseRecalls', 1 );
|
||||
t::lib::Mocks::mock_preference( 'UseRecalls', 'opac' );
|
||||
|
||||
my $patron = $builder->build_object( { class => 'Koha::Patrons' } );
|
||||
|
||||
|
|
@ -188,7 +188,7 @@ subtest '_status() tests' => sub {
|
|||
}
|
||||
}
|
||||
|
||||
t::lib::Mocks::mock_preference( 'UseRecalls', 0 );
|
||||
t::lib::Mocks::mock_preference( 'UseRecalls', 'off' );
|
||||
$schema->storage->txn_rollback;
|
||||
};
|
||||
|
||||
|
|
@ -2994,7 +2994,7 @@ subtest 'Recalls tests' => sub {
|
|||
);
|
||||
|
||||
t::lib::Mocks::mock_userenv( { patron => $patron1 } );
|
||||
t::lib::Mocks::mock_preference( 'UseRecalls', 1 );
|
||||
t::lib::Mocks::mock_preference( 'UseRecalls', 'opac' );
|
||||
|
||||
my $recall1 = Koha::Recall->new(
|
||||
{
|
||||
|
|
@ -3024,10 +3024,10 @@ subtest 'Recalls tests' => sub {
|
|||
|
||||
$recall2->set_cancelled;
|
||||
|
||||
t::lib::Mocks::mock_preference( 'UseRecalls', 0 );
|
||||
t::lib::Mocks::mock_preference( 'UseRecalls', 'off' );
|
||||
is( $item1->can_be_recalled( { patron => $patron1 } ), 0, "Can't recall with UseRecalls disabled" );
|
||||
|
||||
t::lib::Mocks::mock_preference( "UseRecalls", 1 );
|
||||
t::lib::Mocks::mock_preference( "UseRecalls", 'opac' );
|
||||
|
||||
$item1->update( { notforloan => 1 } );
|
||||
is( $item1->can_be_recalled( { patron => $patron1 } ), 0, "Can't recall that is not for loan" );
|
||||
|
|
@ -3247,7 +3247,7 @@ subtest 'has_pending_recall() tests' => sub {
|
|||
my $patron = $builder->build_object( { class => 'Koha::Patrons' } );
|
||||
|
||||
t::lib::Mocks::mock_userenv( { branchcode => $library->branchcode } );
|
||||
t::lib::Mocks::mock_preference( 'UseRecalls', 1 );
|
||||
t::lib::Mocks::mock_preference( 'UseRecalls', 'opac' );
|
||||
|
||||
C4::Circulation::AddIssue( $patron, $item->barcode );
|
||||
|
||||
|
|
|
|||
|
|
@ -1557,7 +1557,7 @@ subtest do_checkout_with_recalls => sub {
|
|||
}
|
||||
);
|
||||
|
||||
t::lib::Mocks::mock_preference( 'UseRecalls', 1 );
|
||||
t::lib::Mocks::mock_preference( 'UseRecalls', 'opac' );
|
||||
Koha::CirculationRules->set_rule(
|
||||
{
|
||||
branchcode => undef,
|
||||
|
|
|
|||
|
|
@ -161,7 +161,7 @@ $contextmodule->mock(
|
|||
} elsif ( $pref eq 'SearchLimitLibrary' ) {
|
||||
return 'both';
|
||||
} elsif ( $pref eq 'UseRecalls' ) {
|
||||
return '0';
|
||||
return 'off';
|
||||
} elsif ( $pref eq 'ContentWarningField' ) {
|
||||
return q{};
|
||||
} elsif ( $pref eq 'AuthorLinkSortBy' ) {
|
||||
|
|
|
|||
|
|
@ -202,7 +202,7 @@ subtest 'buildKohaItemsNamespace status tests' => sub {
|
|||
my $library_name = $holdinglibrary->branchname;
|
||||
like( $xml, qr{<resultbranch>${library_name}</resultbranch>}, "Found resultbranch / holding branch" );
|
||||
|
||||
t::lib::Mocks::mock_preference( 'UseRecalls', 1 );
|
||||
t::lib::Mocks::mock_preference( 'UseRecalls', 'opac' );
|
||||
my $recall = $builder->build_object(
|
||||
{
|
||||
class => 'Koha::Recalls',
|
||||
|
|
@ -220,7 +220,7 @@ subtest 'buildKohaItemsNamespace status tests' => sub {
|
|||
$xml, qr{<substatus>Recall waiting</substatus>},
|
||||
"Waiting status takes precedence over In transit (recalls)"
|
||||
);
|
||||
t::lib::Mocks::mock_preference( 'UseRecalls', 0 );
|
||||
t::lib::Mocks::mock_preference( 'UseRecalls', 'off' );
|
||||
|
||||
$schema->storage->txn_rollback;
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue