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

(-)a/t/db_dependent/Acquisition.t (-3 lines)
Lines 125-133 sub _check_fields_of_orders { Link Here
125
my $schema = Koha::Database->new()->schema();
125
my $schema = Koha::Database->new()->schema();
126
$schema->storage->txn_begin();
126
$schema->storage->txn_begin();
127
127
128
my $dbh = C4::Context->dbh;
129
$dbh->{RaiseError} = 1;
130
131
# Creating some orders
128
# Creating some orders
132
my $bookseller = Koha::Acquisition::Bookseller->new(
129
my $bookseller = Koha::Acquisition::Bookseller->new(
133
    {
130
    {
(-)a/t/db_dependent/Acquisition/CancelReceipt.t (-2 lines)
Lines 36-43 use MARC::Record; Link Here
36
36
37
my $schema = Koha::Database->new()->schema();
37
my $schema = Koha::Database->new()->schema();
38
$schema->storage->txn_begin();
38
$schema->storage->txn_begin();
39
my $dbh = C4::Context->dbh;
40
$dbh->{RaiseError} = 1;
41
39
42
my $builder = t::lib::TestBuilder->new;
40
my $builder = t::lib::TestBuilder->new;
43
my $itemtype = $builder->build({ source => 'Itemtype' })->{ itemtype };
41
my $itemtype = $builder->build({ source => 'Itemtype' })->{ itemtype };
(-)a/t/db_dependent/Acquisition/GetBasketsInfosByBookseller.t (-3 lines)
Lines 14-22 use Koha::Acquisition::Orders; Link Here
14
my $schema = Koha::Database->new()->schema();
14
my $schema = Koha::Database->new()->schema();
15
$schema->storage->txn_begin();
15
$schema->storage->txn_begin();
16
16
17
my $dbh = C4::Context->dbh;
18
$dbh->{RaiseError} = 1;
19
20
my $supplier = Koha::Acquisition::Bookseller->new(
17
my $supplier = Koha::Acquisition::Bookseller->new(
21
    {
18
    {
22
        name => 'my vendor',
19
        name => 'my vendor',
(-)a/t/db_dependent/Acquisition/GetOrdersByBiblionumber.t (-2 lines)
Lines 14-21 use MARC::Record; Link Here
14
#Start transaction
14
#Start transaction
15
my $schema = Koha::Database->new()->schema();
15
my $schema = Koha::Database->new()->schema();
16
$schema->storage->txn_begin();
16
$schema->storage->txn_begin();
17
my $dbh = C4::Context->dbh;
18
$dbh->{RaiseError} = 1;
19
17
20
my $bookseller = Koha::Acquisition::Bookseller->new(
18
my $bookseller = Koha::Acquisition::Bookseller->new(
21
    {
19
    {
(-)a/t/db_dependent/Acquisition/Invoices.t (-1 lines)
Lines 17-23 BEGIN { Link Here
17
my $schema = Koha::Database->new()->schema();
17
my $schema = Koha::Database->new()->schema();
18
$schema->storage->txn_begin();
18
$schema->storage->txn_begin();
19
my $dbh = C4::Context->dbh;
19
my $dbh = C4::Context->dbh;
20
$dbh->{RaiseError} = 1;
21
20
22
$dbh->do(q{DELETE FROM aqinvoices});
21
$dbh->do(q{DELETE FROM aqinvoices});
23
22
(-)a/t/db_dependent/Acquisition/NewOrder.t (-2 lines)
Lines 16-23 use t::lib::Mocks; Link Here
16
16
17
my $schema = Koha::Database->new()->schema();
17
my $schema = Koha::Database->new()->schema();
18
$schema->storage->txn_begin();
18
$schema->storage->txn_begin();
19
my $dbh = C4::Context->dbh;
20
$dbh->{RaiseError} = 1;
21
19
22
my $builder = t::lib::TestBuilder->new;
20
my $builder = t::lib::TestBuilder->new;
23
my $logged_in_user = $builder->build_object({ class => 'Koha::Patrons' });
21
my $logged_in_user = $builder->build_object({ class => 'Koha::Patrons' });
(-)a/t/db_dependent/Acquisition/OrderFromSubscription.t (-1 lines)
Lines 17-23 my $schema = Koha::Database->new()->schema(); Link Here
17
$schema->storage->txn_begin();
17
$schema->storage->txn_begin();
18
my $builder = t::lib::TestBuilder->new;
18
my $builder = t::lib::TestBuilder->new;
19
my $dbh = C4::Context->dbh;
19
my $dbh = C4::Context->dbh;
20
$dbh->{RaiseError} = 1;
21
20
22
my $curcode = $builder->build({ source => 'Currency' })->{currencycode};
21
my $curcode = $builder->build({ source => 'Currency' })->{currencycode};
23
22
(-)a/t/db_dependent/Acquisition/TransferOrder.t (-3 lines)
Lines 17-25 use MARC::Record; Link Here
17
my $schema = Koha::Database->new()->schema();
17
my $schema = Koha::Database->new()->schema();
18
$schema->storage->txn_begin();
18
$schema->storage->txn_begin();
19
19
20
my $dbh = C4::Context->dbh;
21
$dbh->{RaiseError} = 1;
22
23
my $bookseller1 = Koha::Acquisition::Bookseller->new(
20
my $bookseller1 = Koha::Acquisition::Bookseller->new(
24
    {
21
    {
25
        name => "my vendor 1",
22
        name => "my vendor 1",
(-)a/t/db_dependent/Acquisition/close_reopen_basket.t (-1 lines)
Lines 16-22 my $schema = Koha::Database->new()->schema(); Link Here
16
$schema->storage->txn_begin();
16
$schema->storage->txn_begin();
17
17
18
my $dbh = C4::Context->dbh;
18
my $dbh = C4::Context->dbh;
19
$dbh->{RaiseError} = 1;
20
19
21
$dbh->do(q{
20
$dbh->do(q{
22
    DELETE FROM aqorders;
21
    DELETE FROM aqorders;
(-)a/t/db_dependent/Acquisition/populate_order_with_prices.t (-3 lines)
Lines 13-21 use t::lib::Mocks; Link Here
13
my $schema = Koha::Database->new()->schema();
13
my $schema = Koha::Database->new()->schema();
14
$schema->storage->txn_begin();
14
$schema->storage->txn_begin();
15
15
16
my $dbh = C4::Context->dbh;
17
$dbh->{RaiseError} = 1;
18
19
my $builder = t::lib::TestBuilder->new;
16
my $builder = t::lib::TestBuilder->new;
20
17
21
my $bookseller_inc_tax = Koha::Acquisition::Bookseller->new(
18
my $bookseller_inc_tax = Koha::Acquisition::Bookseller->new(
(-)a/t/db_dependent/ArticleRequests.t (-1 lines)
Lines 44-50 my $builder = t::lib::TestBuilder->new; Link Here
44
our $cache = Koha::Caches->get_instance;
44
our $cache = Koha::Caches->get_instance;
45
45
46
my $dbh = C4::Context->dbh;
46
my $dbh = C4::Context->dbh;
47
$dbh->{RaiseError} = 1;
48
47
49
$dbh->do("DELETE FROM circulation_rules");
48
$dbh->do("DELETE FROM circulation_rules");
50
49
(-)a/t/db_dependent/AudioAlerts.t (-3 lines)
Lines 27-35 BEGIN { Link Here
27
my $schema = Koha::Database->new()->schema();
27
my $schema = Koha::Database->new()->schema();
28
$schema->storage->txn_begin();
28
$schema->storage->txn_begin();
29
29
30
my $dbh = C4::Context->dbh;
31
$dbh->{RaiseError} = 1;
32
33
map { $_->delete() } Koha::AudioAlerts->search();
30
map { $_->delete() } Koha::AudioAlerts->search();
34
31
35
## Check the basics
32
## Check the basics
(-)a/t/db_dependent/Auth_with_cas.t (-1 lines)
Lines 37-43 BEGIN { Link Here
37
37
38
my $schema = Koha::Database->new->schema;
38
my $schema = Koha::Database->new->schema;
39
$schema->storage->txn_begin;
39
$schema->storage->txn_begin;
40
my $dbh = C4::Context->dbh;
41
40
42
C4::Context->disable_syspref_cache();
41
C4::Context->disable_syspref_cache();
43
t::lib::Mocks::mock_preference('OPACBaseURL','http://localhost');
42
t::lib::Mocks::mock_preference('OPACBaseURL','http://localhost');
(-)a/t/db_dependent/Bookseller.t (-1 lines)
Lines 37-43 my $dbh = C4::Context->dbh; Link Here
37
my $database = Koha::Database->new();
37
my $database = Koha::Database->new();
38
my $schema = $database->schema();
38
my $schema = $database->schema();
39
$schema->storage->txn_begin();
39
$schema->storage->txn_begin();
40
$dbh->{RaiseError} = 1;
41
my $builder = t::lib::TestBuilder->new;
40
my $builder = t::lib::TestBuilder->new;
42
41
43
#Start tests
42
#Start tests
(-)a/t/db_dependent/Circulation.t (-3 lines)
Lines 105-113 my $now_value = dt_from_string; Link Here
105
my $mocked_datetime = Test::MockModule->new('DateTime');
105
my $mocked_datetime = Test::MockModule->new('DateTime');
106
$mocked_datetime->mock( 'now', sub { return $now_value->clone; } );
106
$mocked_datetime->mock( 'now', sub { return $now_value->clone; } );
107
107
108
# Start transaction
109
$dbh->{RaiseError} = 1;
110
111
my $cache = Koha::Caches->get_instance();
108
my $cache = Koha::Caches->get_instance();
112
$dbh->do(q|DELETE FROM special_holidays|);
109
$dbh->do(q|DELETE FROM special_holidays|);
113
$dbh->do(q|DELETE FROM repeatable_holidays|);
110
$dbh->do(q|DELETE FROM repeatable_holidays|);
(-)a/t/db_dependent/Circulation/GetTopIssues.t (-1 lines)
Lines 35-41 my $dbh = $schema->storage->dbh; Link Here
35
my $builder = t::lib::TestBuilder->new();
35
my $builder = t::lib::TestBuilder->new();
36
36
37
# Start transaction
37
# Start transaction
38
$dbh->{RaiseError} = 1;
39
$schema->storage->txn_begin();
38
$schema->storage->txn_begin();
40
39
41
my $itemtype = $builder->build({ source => 'Itemtype' })->{ itemtype };
40
my $itemtype = $builder->build({ source => 'Itemtype' })->{ itemtype };
(-)a/t/db_dependent/Circulation/IssuingRules/maxsuspensiondays.t (-1 lines)
Lines 20-26 my $schema = Koha::Database->schema; Link Here
20
$schema->storage->txn_begin;
20
$schema->storage->txn_begin;
21
my $builder = t::lib::TestBuilder->new;
21
my $builder = t::lib::TestBuilder->new;
22
my $dbh = C4::Context->dbh;
22
my $dbh = C4::Context->dbh;
23
$dbh->{RaiseError} = 1;
24
23
25
my $branchcode = $builder->build({ source => 'Branch' })->{branchcode};
24
my $branchcode = $builder->build({ source => 'Branch' })->{branchcode};
26
my $itemtype   = $builder->build({ source => 'Itemtype' })->{itemtype};
25
my $itemtype   = $builder->build({ source => 'Itemtype' })->{itemtype};
(-)a/t/db_dependent/CourseReserves.t (-2 lines)
Lines 34-41 BEGIN { Link Here
34
my $schema = Koha::Database->schema;
34
my $schema = Koha::Database->schema;
35
$schema->storage->txn_begin;
35
$schema->storage->txn_begin;
36
my $builder = t::lib::TestBuilder->new;
36
my $builder = t::lib::TestBuilder->new;
37
my $dbh = C4::Context->dbh;
38
$dbh->{RaiseError} = 1;
39
37
40
my $branchcode = $builder->build( { source => 'Branch' } )->{branchcode};
38
my $branchcode = $builder->build( { source => 'Branch' } )->{branchcode};
41
my $itemtype = $builder->build(
39
my $itemtype = $builder->build(
(-)a/t/db_dependent/DecreaseLoanHighHolds.t (-2 lines)
Lines 35-42 my $dbh = C4::Context->dbh; Link Here
35
my $schema = Koha::Database->new()->schema();
35
my $schema = Koha::Database->new()->schema();
36
my $builder = t::lib::TestBuilder->new;
36
my $builder = t::lib::TestBuilder->new;
37
37
38
# Start transaction
39
$dbh->{RaiseError} = 1;
40
$schema->storage->txn_begin();
38
$schema->storage->txn_begin();
41
39
42
my $now_value       = DateTime->now();
40
my $now_value       = DateTime->now();
(-)a/t/db_dependent/Filter_MARC_ViewPolicy.t (-1 lines)
Lines 41-47 my $dbh = C4::Context->dbh; Link Here
41
41
42
my $database = Koha::Database->new();
42
my $database = Koha::Database->new();
43
my $schema   = $database->schema();
43
my $schema   = $database->schema();
44
$dbh->{RaiseError} = 1;
45
44
46
sub run_hiding_tests {
45
sub run_hiding_tests {
47
46
(-)a/t/db_dependent/Holds/RevertWaitingStatus.t (-1 lines)
Lines 33-39 my $schema = Koha::Database->schema; Link Here
33
$schema->storage->txn_begin;
33
$schema->storage->txn_begin;
34
my $builder = t::lib::TestBuilder->new;
34
my $builder = t::lib::TestBuilder->new;
35
my $dbh = C4::Context->dbh;
35
my $dbh = C4::Context->dbh;
36
$dbh->{RaiseError} = 1;
37
36
38
$dbh->do("DELETE FROM reserves");
37
$dbh->do("DELETE FROM reserves");
39
$dbh->do("DELETE FROM old_reserves");
38
$dbh->do("DELETE FROM old_reserves");
(-)a/t/db_dependent/Installer.t (-2 lines)
Lines 57-64 my $column_name = $column_names[0]; Link Here
57
ok( column_exists( 'borrowers', $column_name ), 'Known column does exist' );
57
ok( column_exists( 'borrowers', $column_name ), 'Known column does exist' );
58
ok( ! column_exists( 'borrowers', 'xxx'), 'Column xxx does not exist' );
58
ok( ! column_exists( 'borrowers', 'xxx'), 'Column xxx does not exist' );
59
{
59
{
60
    my $dbh = C4::Context->dbh;
61
    $dbh->{RaiseError} = 1;
62
    ok( ! column_exists( 'this_table_will_never_exist', 'xxx'), 'Column xxx does not exist, the table does not exist' );
60
    ok( ! column_exists( 'this_table_will_never_exist', 'xxx'), 'Column xxx does not exist, the table does not exist' );
63
}
61
}
64
my @constraint_names = $source->unique_constraint_names();
62
my @constraint_names = $source->unique_constraint_names();
(-)a/t/db_dependent/Items.t (-2 lines)
Lines 73-80 subtest 'General Add, Get and Del tests' => sub { Link Here
73
73
74
74
75
    # Do not modify anything, and do not explode!
75
    # Do not modify anything, and do not explode!
76
    my $dbh = C4::Context->dbh;
77
    local $dbh->{RaiseError} = 1;
78
    ModItem({}, $biblio->biblionumber, $itemnumber);
76
    ModItem({}, $biblio->biblionumber, $itemnumber);
79
77
80
    # Modify item; setting barcode.
78
    # Modify item; setting barcode.
(-)a/t/db_dependent/Koha/Acquisition/Currencies.t (-4 lines)
Lines 26-35 use t::lib::TestBuilder; Link Here
26
26
27
my $schema = Koha::Database->schema;
27
my $schema = Koha::Database->schema;
28
$schema->storage->txn_begin;
28
$schema->storage->txn_begin;
29
my $dbh = C4::Context->dbh;
30
31
# Start transaction
32
$dbh->{RaiseError} = 1;
33
29
34
my $builder = t::lib::TestBuilder->new;
30
my $builder = t::lib::TestBuilder->new;
35
my $nb_of_currencies = Koha::Acquisition::Currencies->search->count;
31
my $nb_of_currencies = Koha::Acquisition::Currencies->search->count;
(-)a/t/db_dependent/Koha_Misc_Files.t (-1 lines)
Lines 14-20 BEGIN { Link Here
14
14
15
my $schema = Koha::Database->new->schema;
15
my $schema = Koha::Database->new->schema;
16
$schema->storage->txn_begin;
16
$schema->storage->txn_begin;
17
my $dbh = C4::Context->dbh;
18
17
19
## new() parameter handling check
18
## new() parameter handling check
20
is(Koha::Misc::Files->new(), undef, "new() param check test/0");
19
is(Koha::Misc::Files->new(), undef, "new() param check test/0");
(-)a/t/db_dependent/Letters.t (-1 lines)
Lines 55-61 $schema->storage->txn_begin(); Link Here
55
55
56
my $builder = t::lib::TestBuilder->new;
56
my $builder = t::lib::TestBuilder->new;
57
my $dbh = C4::Context->dbh;
57
my $dbh = C4::Context->dbh;
58
$dbh->{RaiseError} = 1;
59
58
60
$dbh->do(q|DELETE FROM letter|);
59
$dbh->do(q|DELETE FROM letter|);
61
$dbh->do(q|DELETE FROM message_queue|);
60
$dbh->do(q|DELETE FROM message_queue|);
(-)a/t/db_dependent/Letters/TemplateToolkit.t (-1 lines)
Lines 54-60 $schema->storage->txn_begin(); Link Here
54
my $builder = t::lib::TestBuilder->new();
54
my $builder = t::lib::TestBuilder->new();
55
55
56
my $dbh = C4::Context->dbh;
56
my $dbh = C4::Context->dbh;
57
$dbh->{RaiseError} = 1;
58
57
59
$dbh->do(q|DELETE FROM letter|);
58
$dbh->do(q|DELETE FROM letter|);
60
59
(-)a/t/db_dependent/Members/Attributes.t (-1 lines)
Lines 34-40 my $schema = Koha::Database->schema; Link Here
34
$schema->storage->txn_begin;
34
$schema->storage->txn_begin;
35
my $builder = t::lib::TestBuilder->new;
35
my $builder = t::lib::TestBuilder->new;
36
my $dbh = C4::Context->dbh;
36
my $dbh = C4::Context->dbh;
37
$dbh->{RaiseError} = 1;
38
37
39
$dbh->do(q|DELETE FROM issues|);
38
$dbh->do(q|DELETE FROM issues|);
40
$dbh->do(q|DELETE FROM borrowers|);
39
$dbh->do(q|DELETE FROM borrowers|);
(-)a/t/db_dependent/Passwordrecovery.t (-3 lines)
Lines 44-52 use_ok('Koha::Patron::Password::Recovery'); Link Here
44
my $schema = Koha::Database->new()->schema();
44
my $schema = Koha::Database->new()->schema();
45
$schema->storage->txn_begin();
45
$schema->storage->txn_begin();
46
46
47
my $dbh = C4::Context->dbh;
48
$dbh->{RaiseError} = 1;
49
50
#
47
#
51
# Start with fresh data
48
# Start with fresh data
52
#
49
#
(-)a/t/db_dependent/Patron/Relationships.t (-5 lines)
Lines 30-40 BEGIN { Link Here
30
    use_ok('Koha::Patron::Relationships');
30
    use_ok('Koha::Patron::Relationships');
31
}
31
}
32
32
33
# Start transaction
34
my $dbh = C4::Context->dbh;
35
$dbh->{AutoCommit} = 0;
36
$dbh->{RaiseError} = 1;
37
38
my $builder = t::lib::TestBuilder->new();
33
my $builder = t::lib::TestBuilder->new();
39
34
40
# Father
35
# Father
(-)a/t/db_dependent/Reports/Guided.t (+1 lines)
Lines 260-265 subtest 'get_saved_reports' => sub { Link Here
260
        defined($errors) && exists($errors->{queryerr}),
260
        defined($errors) && exists($errors->{queryerr}),
261
        'attempting to run a report with an SQL syntax error returns error message (Bug 12214)'
261
        'attempting to run a report with an SQL syntax error returns error message (Bug 12214)'
262
    );
262
    );
263
    $dbh->{RaiseError} = 1;
263
264
264
    is_deeply( get_report_areas(), [ 'CIRC', 'CAT', 'PAT', 'ACQ', 'ACC', 'SER' ],
265
    is_deeply( get_report_areas(), [ 'CIRC', 'CAT', 'PAT', 'ACQ', 'ACC', 'SER' ],
265
        "get_report_areas returns the correct array of report areas");
266
        "get_report_areas returns the correct array of report areas");
(-)a/t/db_dependent/Serials/Frequency.t (-1 lines)
Lines 7-13 use Modern::Perl; Link Here
7
7
8
my $schema = Koha::Database->new->schema;
8
my $schema = Koha::Database->new->schema;
9
$schema->storage->txn_begin;
9
$schema->storage->txn_begin;
10
my $dbh = C4::Context->dbh;
11
10
12
use C4::Serials::Frequency;
11
use C4::Serials::Frequency;
13
12
(-)a/t/db_dependent/Serials/GetNextSeq.t (-1 lines)
Lines 7-13 use Koha::Database; Link Here
7
7
8
my $schema = Koha::Database->new->schema;
8
my $schema = Koha::Database->new->schema;
9
$schema->storage->txn_begin;
9
$schema->storage->txn_begin;
10
my $dbh = C4::Context->dbh;
11
10
12
use C4::Serials::Frequency;
11
use C4::Serials::Frequency;
13
use C4::Serials;
12
use C4::Serials;
(-)a/t/db_dependent/Serials/Numberpattern.t (-1 lines)
Lines 8-14 use Koha::Database; Link Here
8
8
9
my $schema = Koha::Database->new->schema;
9
my $schema = Koha::Database->new->schema;
10
$schema->storage->txn_begin;
10
$schema->storage->txn_begin;
11
my $dbh = C4::Context->dbh;
12
11
13
use C4::Serials::Numberpattern;
12
use C4::Serials::Numberpattern;
14
13
(-)a/t/db_dependent/Serials_2.t (-1 lines)
Lines 29-35 my $library2 = $builder->build({ Link Here
29
});
29
});
30
my $patron_category = $builder->build({ source => 'Category' });
30
my $patron_category = $builder->build({ source => 'Category' });
31
my $dbh = C4::Context->dbh;
31
my $dbh = C4::Context->dbh;
32
$dbh->{RaiseError} = 1;
33
32
34
my $record = MARC::Record->new();
33
my $record = MARC::Record->new();
35
$record->append_fields(
34
$record->append_fields(
(-)a/t/db_dependent/ShelfBrowser.t (-1 lines)
Lines 19-25 my $schema = Koha::Database->schema; Link Here
19
$schema->storage->txn_begin;
19
$schema->storage->txn_begin;
20
my $builder = t::lib::TestBuilder->new;
20
my $builder = t::lib::TestBuilder->new;
21
my $dbh = C4::Context->dbh;
21
my $dbh = C4::Context->dbh;
22
$dbh->{RaiseError} = 1;
23
22
24
$dbh->do(q|DELETE FROM reserves|);
23
$dbh->do(q|DELETE FROM reserves|);
25
$dbh->do(q|DELETE FROM issues|);
24
$dbh->do(q|DELETE FROM issues|);
(-)a/t/db_dependent/cronjobs/advance_notices_digest.t (-3 lines)
Lines 39-46 my $borrower; Link Here
39
39
40
sub build_test_objects {
40
sub build_test_objects {
41
41
42
    $dbh->{RaiseError} = 1;
43
44
    # Set only to avoid exception.
42
    # Set only to avoid exception.
45
    t::lib::Mocks::mock_preference('dateformat', 'metric');
43
    t::lib::Mocks::mock_preference('dateformat', 'metric');
46
44
47
- 

Return to bug 22001