@@ -, +, @@ --- t/db_dependent/Circulation.t | 29 +++++++++-------------------- 1 file changed, 9 insertions(+), 20 deletions(-) --- a/t/db_dependent/Circulation.t +++ a/t/db_dependent/Circulation.t @@ -1955,42 +1955,31 @@ subtest 'AddReturn + suspension_chargeperiod' => sub { subtest 'CanBookBeIssued + AutoReturnCheckedOutItems' => sub { plan tests => 2; - my $library = $builder->build( { source => 'Branch' } ); - my $patron_category_x = $builder->build_object( - { - class => 'Koha::Patron::Categories', - value => { category_type => 'X' } - } - ); - + 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}, - categorycode => $patron_category_x->categorycode, - 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; --