|
Lines 19-31
Link Here
|
| 19 |
|
19 |
|
| 20 |
use Modern::Perl; |
20 |
use Modern::Perl; |
| 21 |
|
21 |
|
| 22 |
use Test::More tests => 7; |
22 |
use Test::More tests => 8; |
| 23 |
use t::lib::TestBuilder; |
23 |
use t::lib::TestBuilder; |
| 24 |
|
24 |
|
| 25 |
use List::MoreUtils qw( any none ); |
25 |
use List::MoreUtils qw( any none ); |
| 26 |
|
26 |
|
| 27 |
use C4::Biblio qw(AddBiblio); |
27 |
use C4::Biblio qw(AddBiblio); |
| 28 |
use C4::Reserves; |
28 |
use C4::Reserves; |
|
|
29 |
use C4::ClassSource; |
| 29 |
use Koha::AuthorisedValues; |
30 |
use Koha::AuthorisedValues; |
| 30 |
use Koha::Biblios; |
31 |
use Koha::Biblios; |
| 31 |
use Koha::Database; |
32 |
use Koha::Database; |
|
Lines 59-64
subtest 'Old version is unchanged' => sub {
Link Here
|
| 59 |
$schema->storage->txn_rollback; |
60 |
$schema->storage->txn_rollback; |
| 60 |
}; |
61 |
}; |
| 61 |
|
62 |
|
|
|
63 |
<<<<<<< HEAD |
| 62 |
subtest 'Skip items with waiting holds' => sub { |
64 |
subtest 'Skip items with waiting holds' => sub { |
| 63 |
|
65 |
|
| 64 |
plan tests => 6; |
66 |
plan tests => 6; |
|
Lines 125-130
subtest 'Skip items with waiting holds' => sub {
Link Here
|
| 125 |
'Item on hold skipped, no one matches' ); |
127 |
'Item on hold skipped, no one matches' ); |
| 126 |
|
128 |
|
| 127 |
$schema->storage->txn_rollback; |
129 |
$schema->storage->txn_rollback; |
|
|
130 |
======= |
| 131 |
$dbh->rollback; |
| 132 |
$dbh->{AutoCommit} = 1; |
| 133 |
|
| 134 |
subtest 'Use cn_sort rather than callnumber to determine correct location' => sub { |
| 135 |
|
| 136 |
plan tests => 1; |
| 137 |
my $builder = t::lib::TestBuilder->new; |
| 138 |
my $schema = Koha::Database->new->schema; |
| 139 |
$schema->storage->txn_begin; |
| 140 |
$builder->schema->resultset( 'Issue' )->delete_all; |
| 141 |
$builder->schema->resultset( 'Item' )->delete_all; |
| 142 |
|
| 143 |
my $class_rule = $builder->build({ |
| 144 |
source => 'ClassSortRule', |
| 145 |
value => { sort_routine => "LCC" } |
| 146 |
}); |
| 147 |
my $class_source = $builder->build({ |
| 148 |
source => 'ClassSource', |
| 149 |
value => { |
| 150 |
class_sort_rule => $class_rule->{class_sort_rule}, |
| 151 |
} |
| 152 |
}); |
| 153 |
my $item_1 = $builder->build({ |
| 154 |
source => 'Item', |
| 155 |
value => { |
| 156 |
itemcallnumber => 'GT95', |
| 157 |
cn_sort => GetClassSort($class_source->{cn_source},undef,'GT95'), |
| 158 |
} |
| 159 |
}); |
| 160 |
|
| 161 |
my( undef, $item_count) = GetItemsForInventory({ |
| 162 |
maxlocation => 'GT100', |
| 163 |
minlocation => 'GT90', |
| 164 |
class_source => $class_source->{cn_source}, |
| 165 |
}); |
| 166 |
is($item_count,1,"We should return GT95 as between GT90 and GT100"); |
| 167 |
$schema->storage->txn_rollback; |
| 168 |
|
| 169 |
>>>>>>> Bug 19915: Add unit test to GetItemsForInventory.t |
| 128 |
}; |
170 |
}; |
| 129 |
|
171 |
|
| 130 |
sub OldWay { |
172 |
sub OldWay { |
| 131 |
- |
|
|