View | Details | Raw Unified | Return to bug 19915
Collapse All | Expand All

(-)a/t/db_dependent/Items/GetItemsForInventory.t (-14 / +17 lines)
Lines 60-66 subtest 'Old version is unchanged' => sub { Link Here
60
    $schema->storage->txn_rollback;
60
    $schema->storage->txn_rollback;
61
};
61
};
62
62
63
<<<<<<< HEAD
64
subtest 'Skip items with waiting holds' => sub {
63
subtest 'Skip items with waiting holds' => sub {
65
64
66
    plan tests => 6;
65
    plan tests => 6;
Lines 127-144 subtest 'Skip items with waiting holds' => sub { Link Here
127
        'Item on hold skipped, no one matches' );
126
        'Item on hold skipped, no one matches' );
128
127
129
    $schema->storage->txn_rollback;
128
    $schema->storage->txn_rollback;
130
=======
129
};
131
$dbh->rollback;
132
$dbh->{AutoCommit} = 1;
133
130
134
subtest 'Use cn_sort rather than callnumber to determine correct location' => sub {
131
subtest 'Verify results with OldWay' => sub {
132
    $schema->storage->txn_begin;
133
    plan tests => 1;
135
134
135
    my ($oldResults, $oldCount) = OldWay();
136
    my ($newResults, $newCount) = GetItemsForInventory();
137
    is_deeply($newResults,$oldResults,"Inventory results unchanged.");
138
    $schema->storage->txn_rollback;
139
};
140
141
subtest 'Use cn_sort rather than callnumber to determine correct location' => sub {
142
    $schema->storage->txn_begin;
136
    plan tests => 1;
143
    plan tests => 1;
144
137
    my $builder = t::lib::TestBuilder->new;
145
    my $builder = t::lib::TestBuilder->new;
138
    my $schema  = Koha::Database->new->schema;
146
    Koha::Items->delete;
139
    $schema->storage->txn_begin;
140
    $builder->schema->resultset( 'Issue' )->delete_all;
141
    $builder->schema->resultset( 'Item' )->delete_all;
142
147
143
    my $class_rule = $builder->build({
148
    my $class_rule = $builder->build({
144
        source => 'ClassSortRule',
149
        source => 'ClassSortRule',
Lines 166-177 subtest 'Use cn_sort rather than callnumber to determine correct location' => su Link Here
166
    is($item_count,1,"We should return GT95 as between GT90 and GT100");
171
    is($item_count,1,"We should return GT95 as between GT90 and GT100");
167
    $schema->storage->txn_rollback;
172
    $schema->storage->txn_rollback;
168
173
169
>>>>>>> Bug 19915: Add unit test to GetItemsForInventory.t
170
};
174
};
171
175
172
sub OldWay {
176
sub OldWay { # FIXME Do we really still need so much code to check results ??
173
    my ($tdbh)       = @_;
177
    my $ldbh = C4::Context->dbh;
174
    my $ldbh         = $tdbh;
178
175
    my $minlocation  = '';
179
    my $minlocation  = '';
176
    my $maxlocation  = '';
180
    my $maxlocation  = '';
177
    my $location     = '';
181
    my $location     = '';
178
- 

Return to bug 19915