use t::lib::Mocks;
use t::lib::TestBuilder;
-use C4::Circulation;
+use C4::Circulation qw( MarkIssueReturned AddIssue );
use C4::Context;
use Koha::Checkouts;
use Koha::Database;
value => { branchcode => $library->branchcode, categorycode => $category->categorycode }
}
);
- my $biblioitem = $builder->build_object( { class => 'Koha::Biblioitems' } );
- my $item = $builder->build_object(
- { class => 'Koha::Items',
- value => {
- homebranch => $library->branchcode,
- holdingbranch => $library->branchcode,
- notforloan => 0,
- itemlost => 0,
- withdrawn => 0,
- biblionumber => $biblioitem->biblionumber,
- }
+ my $item = $builder->build_sample_item(
+ {
+ library => $library->branchcode,
}
);
value => { branchcode => $library->branchcode, categorycode => $category->categorycode }
}
);
- my $biblioitem = $builder->build_object( { class => 'Koha::Biblioitems' } );
- my $item = $builder->build_object(
- { class => 'Koha::Items',
- value => {
- homebranch => $library->branchcode,
- holdingbranch => $library->branchcode,
- notforloan => 0,
- itemlost => 0,
- withdrawn => 0,
- biblionumber => $biblioitem->biblionumber,
- }
+ my $item = $builder->build_sample_item(
+ {
+ library => $library->branchcode,
}
);
value => { branchcode => $library->branchcode, categorycode => $category->categorycode }
}
);
- my $biblioitem = $builder->build_object( { class => 'Koha::Biblioitems' } );
- my $item = $builder->build_object(
- { class => 'Koha::Items',
- value => {
- homebranch => $library->branchcode,
- holdingbranch => $library->branchcode,
- notforloan => 0,
- itemlost => 0,
- withdrawn => 0,
- biblionumber => $biblioitem->biblionumber,
- }
+ my $item = $builder->build_sample_item(
+ {
+ library => $library->branchcode,
}
);
subtest 'AutoRemoveOverduesRestrictions' => sub {
plan tests => 2;
+ $schema->storage->txn_begin;
+
t::lib::Mocks::mock_preference('AutoRemoveOverduesRestrictions', 1);
my $patron = $builder->build_object({ class => 'Koha::Patrons' });
$debarments = Koha::Patron::Debarments::GetDebarments({ borrowernumber => $patron->borrowernumber });
is( scalar @$debarments, 0, 'OVERDUES debarment is removed if patron does not have overdues' );
+
+ $schema->storage->txn_rollback;
};