Lines 1969-1980
subtest "GetHoldsQueueItems" => sub {
Link Here
|
1969 |
}; |
1969 |
}; |
1970 |
|
1970 |
|
1971 |
subtest "Test HoldsQueuePrioritizeBranch" => sub { |
1971 |
subtest "Test HoldsQueuePrioritizeBranch" => sub { |
|
|
1972 |
|
1972 |
plan tests => 4; |
1973 |
plan tests => 4; |
1973 |
|
1974 |
|
1974 |
Koha::Biblios->delete(); |
1975 |
$schema->storage->txn_begin; |
|
|
1976 |
|
1975 |
t::lib::Mocks::mock_preference( 'LocalHoldsPriority', 0 ); |
1977 |
t::lib::Mocks::mock_preference( 'LocalHoldsPriority', 0 ); |
1976 |
t::lib::Mocks::mock_preference( 'HoldsQueuePrioritizeBranch', 'homebranch' ); |
1978 |
t::lib::Mocks::mock_preference( 'UseTransportCostMatrix', 0 ); |
1977 |
t::lib::Mocks::mock_preference('UseTransportCostMatrix', 0); |
|
|
1978 |
|
1979 |
|
1979 |
my $branch1 = $builder->build_object( { class => 'Koha::Libraries' } ); |
1980 |
my $branch1 = $builder->build_object( { class => 'Koha::Libraries' } ); |
1980 |
my $branch2 = $builder->build_object( { class => 'Koha::Libraries' } ); |
1981 |
my $branch2 = $builder->build_object( { class => 'Koha::Libraries' } ); |
Lines 2013-2022
subtest "Test HoldsQueuePrioritizeBranch" => sub {
Link Here
|
2013 |
} |
2014 |
} |
2014 |
); |
2015 |
); |
2015 |
|
2016 |
|
|
|
2017 |
t::lib::Mocks::mock_preference( 'HoldsQueuePrioritizeBranch', 'homebranch' ); |
2018 |
|
2016 |
C4::HoldsQueue::CreateQueue(); |
2019 |
C4::HoldsQueue::CreateQueue(); |
2017 |
|
2020 |
|
2018 |
my $queue_rs = $schema->resultset('TmpHoldsqueue'); |
2021 |
my $queue_rs = $schema->resultset('TmpHoldsqueue')->search({ biblionumber => $biblio->biblionumber }); |
2019 |
my $target_rs = $schema->resultset('HoldFillTarget'); |
|
|
2020 |
is( |
2022 |
is( |
2021 |
$queue_rs->next->itemnumber->itemnumber, |
2023 |
$queue_rs->next->itemnumber->itemnumber, |
2022 |
$item1->itemnumber, |
2024 |
$item1->itemnumber, |
Lines 2027-2047
subtest "Test HoldsQueuePrioritizeBranch" => sub {
Link Here
|
2027 |
|
2029 |
|
2028 |
C4::HoldsQueue::CreateQueue(); |
2030 |
C4::HoldsQueue::CreateQueue(); |
2029 |
|
2031 |
|
2030 |
$queue_rs = $schema->resultset('TmpHoldsqueue'); |
2032 |
$queue_rs = $schema->resultset('TmpHoldsqueue')->search({ biblionumber => $biblio->biblionumber }); |
2031 |
$target_rs = $schema->resultset('HoldFillTarget'); |
|
|
2032 |
is( |
2033 |
is( |
2033 |
$queue_rs->next->itemnumber->itemnumber, |
2034 |
$queue_rs->next->itemnumber->itemnumber, |
2034 |
$item2->itemnumber, |
2035 |
$item2->itemnumber, |
2035 |
"Picked the item whose holdingbranch matches the pickup branch" |
2036 |
"Picked the item whose holdingbranch matches the pickup branch" |
2036 |
); |
2037 |
); |
2037 |
|
2038 |
|
2038 |
t::lib::Mocks::mock_preference('UseTransportCostMatrix', 1); |
|
|
2039 |
t::lib::Mocks::mock_preference( 'HoldsQueuePrioritizeBranch', 'homebranch' ); |
2039 |
t::lib::Mocks::mock_preference( 'HoldsQueuePrioritizeBranch', 'homebranch' ); |
2040 |
|
2040 |
|
2041 |
C4::HoldsQueue::CreateQueue(); |
2041 |
C4::HoldsQueue::CreateQueue(); |
2042 |
|
2042 |
|
2043 |
$queue_rs = $schema->resultset('TmpHoldsqueue'); |
2043 |
$queue_rs = $schema->resultset('TmpHoldsqueue')->search({ biblionumber => $biblio->biblionumber }); |
2044 |
$target_rs = $schema->resultset('HoldFillTarget'); |
|
|
2045 |
is( |
2044 |
is( |
2046 |
$queue_rs->next->itemnumber->itemnumber, |
2045 |
$queue_rs->next->itemnumber->itemnumber, |
2047 |
$item1->itemnumber, |
2046 |
$item1->itemnumber, |
Lines 2052-2062
subtest "Test HoldsQueuePrioritizeBranch" => sub {
Link Here
|
2052 |
|
2051 |
|
2053 |
C4::HoldsQueue::CreateQueue(); |
2052 |
C4::HoldsQueue::CreateQueue(); |
2054 |
|
2053 |
|
2055 |
$queue_rs = $schema->resultset('TmpHoldsqueue'); |
2054 |
$queue_rs = $schema->resultset('TmpHoldsqueue')->search({ biblionumber => $biblio->biblionumber }); |
2056 |
$target_rs = $schema->resultset('HoldFillTarget'); |
|
|
2057 |
is( |
2055 |
is( |
2058 |
$queue_rs->next->itemnumber->itemnumber, |
2056 |
$queue_rs->next->itemnumber->itemnumber, |
2059 |
$item2->itemnumber, |
2057 |
$item2->itemnumber, |
2060 |
"Picked the item whose holdingbranch matches the pickup branch" |
2058 |
"Picked the item whose holdingbranch matches the pickup branch" |
2061 |
); |
2059 |
); |
|
|
2060 |
|
2061 |
$schema->storage->txn_rollback; |
2062 |
}; |
2062 |
}; |
2063 |
- |
|
|