Bug 24062: Fix the failing test

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
Jonathan Druart 2019-11-19 09:40:07 +01:00 committed by Martin Renvoize
parent 5df9c63eea
commit cbe22553fe
No known key found for this signature in database
GPG Key ID: 422B469130441A0F
1 changed files with 9 additions and 12 deletions

View File

@ -1955,34 +1955,31 @@ subtest 'AddReturn + suspension_chargeperiod' => sub {
subtest 'CanBookBeIssued + AutoReturnCheckedOutItems' => sub {
plan tests => 2;
my $library = $builder->build( { source => 'Branch' } );
my $library = $builder->build_object( { class => 'Koha::Libraries' } );
my $patron1 = $builder->build_object(
{
class => 'Koha::Patrons',
value => {
branchcode => $library->{branchcode},
firstname => "Happy",
surname => "Gilmore",
value => {
library => $library->branchcode,
categorycode => $patron_category->{categorycode}
}
}
);
my $patron2 = $builder->build_object(
{
class => 'Koha::Patrons',
value => {
branchcode => $library->{branchcode},
firstname => "Billy",
surname => "Madison",
value => {
library => $library->branchcode,
categorycode => $patron_category->{categorycode}
}
}
);
C4::Context->_new_userenv('xxx');
C4::Context->set_userenv(0,0,0,'firstname','surname', $library->{branchcode}, 'Random Library', '', '', '');
t::lib::Mocks::mock_userenv({ branchcode => $library->branchcode });
my $item = $builder->build_sample_item(
{
library => $library->{branchcode},
library => $library->branchcode,
}
)->unblessed;