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

(-)a/t/db_dependent/Items.t (-16 / +6 lines)
Lines 32-37 BEGIN { Link Here
32
}
32
}
33
33
34
my $dbh = C4::Context->dbh;
34
my $dbh = C4::Context->dbh;
35
$dbh->{RaiseError} = 1;
35
my $branches = GetBranches;
36
my $branches = GetBranches;
36
my ($branch1, $branch2) = keys %$branches;
37
my ($branch1, $branch2) = keys %$branches;
37
38
Lines 40-47 subtest 'General Add, Get and Del tests' => sub { Link Here
40
    plan tests => 10;
41
    plan tests => 10;
41
42
42
    # Start transaction
43
    # Start transaction
43
    $dbh->{AutoCommit} = 0;
44
    local $dbh->{AutoCommit} = 0;
44
    $dbh->{RaiseError} = 1;
45
45
46
    # Create a biblio instance for testing
46
    # Create a biblio instance for testing
47
    C4::Context->set_preference('marcflavour', 'MARC21');
47
    C4::Context->set_preference('marcflavour', 'MARC21');
Lines 92-99 subtest 'GetHiddenItemnumbers tests' => sub { Link Here
92
    # This sub is controlled by the OpacHiddenItems system preference.
92
    # This sub is controlled by the OpacHiddenItems system preference.
93
93
94
    # Start transaction
94
    # Start transaction
95
    $dbh->{AutoCommit} = 0;
95
    local $dbh->{AutoCommit} = 0;
96
    $dbh->{RaiseError} = 1;
97
96
98
    # Create a new biblio
97
    # Create a new biblio
99
    C4::Context->set_preference('marcflavour', 'MARC21');
98
    C4::Context->set_preference('marcflavour', 'MARC21');
Lines 177-184 subtest 'GetItemsInfo tests' => sub { Link Here
177
    plan tests => 4;
176
    plan tests => 4;
178
177
179
    # Start transaction
178
    # Start transaction
180
    $dbh->{AutoCommit} = 0;
179
    local $dbh->{AutoCommit} = 0;
181
    $dbh->{RaiseError} = 1;
182
180
183
    # Add a biblio
181
    # Add a biblio
184
    my ($biblionumber, $biblioitemnumber) = get_biblio();
182
    my ($biblionumber, $biblioitemnumber) = get_biblio();
Lines 213-223 subtest q{Test Koha::Database->schema()->resultset('Item')->itemtype()} => sub { Link Here
213
211
214
    plan tests => 2;
212
    plan tests => 2;
215
213
216
    # Start transaction
217
    $dbh->{AutoCommit} = 0;
218
    $dbh->{RaiseError} = 1;
219
220
    my $schema = Koha::Database->new()->schema();
214
    my $schema = Koha::Database->new()->schema();
215
    $schema->txn_begin;
221
216
222
    my $biblio =
217
    my $biblio =
223
    $schema->resultset('Biblio')->create(
218
    $schema->resultset('Biblio')->create(
Lines 240-255 subtest q{Test Koha::Database->schema()->resultset('Item')->itemtype()} => sub { Link Here
240
235
241
    C4::Context->set_preference( 'item-level_itypes', 1 );
236
    C4::Context->set_preference( 'item-level_itypes', 1 );
242
    ok( $item->effective_itemtype() eq 'ITEM_LEVEL', '$item->itemtype() returns items.itype when item-level_itypes is enabled' );
237
    ok( $item->effective_itemtype() eq 'ITEM_LEVEL', '$item->itemtype() returns items.itype when item-level_itypes is enabled' );
243
244
    $dbh->rollback;
245
};
238
};
246
239
247
subtest 'SearchItems test' => sub {
240
subtest 'SearchItems test' => sub {
248
    plan tests => 14;
241
    plan tests => 14;
249
242
250
    # Start transaction
243
    # Start transaction
251
    $dbh->{AutoCommit} = 0;
244
    local $dbh->{AutoCommit} = 0;
252
    $dbh->{RaiseError} = 1;
253
245
254
    C4::Context->set_preference('marcflavour', 'MARC21');
246
    C4::Context->set_preference('marcflavour', 'MARC21');
255
    my ($biblionumber) = get_biblio();
247
    my ($biblionumber) = get_biblio();
Lines 413-419 subtest 'Koha::Item(s) tests' => sub { Link Here
413
    # Start transaction
405
    # Start transaction
414
    my $schema = Koha::Database->new()->schema();
406
    my $schema = Koha::Database->new()->schema();
415
    $schema->storage->txn_begin();
407
    $schema->storage->txn_begin();
416
    $dbh->{RaiseError} = 1;
417
408
418
    # Create a biblio and item for testing
409
    # Create a biblio and item for testing
419
    C4::Context->set_preference('marcflavour', 'MARC21');
410
    C4::Context->set_preference('marcflavour', 'MARC21');
420
- 

Return to bug 11213