2 use Test::More tests => 2;
12 *C4::Context::userenv = \&Mock_userenv;
14 my $dbh = C4::Context->dbh;
15 $dbh->{AutoCommit} = 0;
16 $dbh->{RaiseError} = 1;
18 my $record = MARC::Record->new();
19 my ( $biblionumber, $biblioitemnumber ) = AddBiblio( $record, '' );
21 my ( undef, undef, $itemnumber ) = AddItem(
24 holdingbranch => 'CPL',
25 barcode => 'i_dont_exist',
27 permanent_location => 'TEST'
34 C4::Context->set_preference( "InProcessingToShelvingCart", 1 );
35 AddReturn( 'i_dont_exist', 'CPL' );
36 $item = GetItem($itemnumber);
37 is( $item->{location}, 'CART', "InProcessingToShelvingCart functions as intended" );
39 $item->{location} = 'PROC';
40 ModItem( $item, undef, $itemnumber );
42 C4::Context->set_preference( "InProcessingToShelvingCart", 0 );
43 AddReturn( 'i_dont_exist', 'CPL' );
44 $item = GetItem($itemnumber);
45 is( $item->{location}, 'TEST', "InProcessingToShelvingCart functions as intended" );
47 # C4::Context->userenv
49 return { branch => 'CPL' };