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

(-)a/t/db_dependent/Acquisition.t (-3 lines)
Lines 123-131 sub _check_fields_of_orders { Link Here
123
my $schema = Koha::Database->new()->schema();
123
my $schema = Koha::Database->new()->schema();
124
$schema->storage->txn_begin();
124
$schema->storage->txn_begin();
125
125
126
my $dbh = C4::Context->dbh;
127
$dbh->{RaiseError} = 1;
128
129
# Creating some orders
126
# Creating some orders
130
my $bookseller = Koha::Acquisition::Bookseller->new(
127
my $bookseller = Koha::Acquisition::Bookseller->new(
131
    {
128
    {
(-)a/t/db_dependent/Acquisition/CancelReceipt.t (-2 lines)
Lines 35-42 use MARC::Record; Link Here
35
35
36
my $schema = Koha::Database->new()->schema();
36
my $schema = Koha::Database->new()->schema();
37
$schema->storage->txn_begin();
37
$schema->storage->txn_begin();
38
my $dbh = C4::Context->dbh;
39
$dbh->{RaiseError} = 1;
40
38
41
my $builder = t::lib::TestBuilder->new;
39
my $builder = t::lib::TestBuilder->new;
42
my $itemtype = $builder->build({ source => 'Itemtype' })->{ itemtype };
40
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 14-21 use Koha::Acquisition::Orders; 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
$dbh->{RaiseError} = 1;
19
17
20
C4::Context->_new_userenv('xxx');
18
C4::Context->_new_userenv('xxx');
21
C4::Context->set_userenv(42, 'ordercreator', '0042', 'Order', 'Creator', 'CPL',
19
C4::Context->set_userenv(42, 'ordercreator', '0042', 'Order', 'Creator', 'CPL',
(-)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/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 issuingrules");
48
$dbh->do("DELETE FROM issuingrules");
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 46-54 $schema->storage->txn_begin; Link Here
46
my $builder = t::lib::TestBuilder->new;
46
my $builder = t::lib::TestBuilder->new;
47
my $dbh = C4::Context->dbh;
47
my $dbh = C4::Context->dbh;
48
48
49
# Start transaction
50
$dbh->{RaiseError} = 1;
51
52
my $cache = Koha::Caches->get_instance();
49
my $cache = Koha::Caches->get_instance();
53
$dbh->do(q|DELETE FROM special_holidays|);
50
$dbh->do(q|DELETE FROM special_holidays|);
54
$dbh->do(q|DELETE FROM repeatable_holidays|);
51
$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 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
my $branchcode = $builder->build({ source => 'Branch' })->{branchcode};
23
my $branchcode = $builder->build({ source => 'Branch' })->{branchcode};
25
my $itemtype   = $builder->build({ source => 'Itemtype' })->{itemtype};
24
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 34-41 my $dbh = C4::Context->dbh; Link Here
34
my $schema = Koha::Database->new()->schema();
34
my $schema = Koha::Database->new()->schema();
35
my $builder = t::lib::TestBuilder->new;
35
my $builder = t::lib::TestBuilder->new;
36
36
37
# Start transaction
38
$dbh->{RaiseError} = 1;
39
$schema->storage->txn_begin();
37
$schema->storage->txn_begin();
40
38
41
$dbh->do('DELETE FROM issues');
39
$dbh->do('DELETE FROM issues');
(-)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/Items.t (-2 lines)
Lines 72-79 subtest 'General Add, Get and Del tests' => sub { Link Here
72
72
73
73
74
    # Do not modify anything, and do not explode!
74
    # Do not modify anything, and do not explode!
75
    my $dbh = C4::Context->dbh;
76
    local $dbh->{RaiseError} = 1;
77
    ModItem({}, $bibnum, $itemnumber);
75
    ModItem({}, $bibnum, $itemnumber);
78
76
79
    # Modify item; setting barcode.
77
    # 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/BiblioUtils.t (-3 lines)
Lines 33-41 use_ok('Koha::Biblios'); Link Here
33
my $schema = Koha::Database->new()->schema();
33
my $schema = Koha::Database->new()->schema();
34
$schema->storage->txn_begin();
34
$schema->storage->txn_begin();
35
35
36
my $dbh = C4::Context->dbh;
37
$dbh->{RaiseError} = 1;
38
39
my @branches = Koha::Libraries->search();
36
my @branches = Koha::Libraries->search();
40
my $borrower = Koha::Patrons->search()->next();
37
my $borrower = Koha::Patrons->search()->next();
41
38
(-)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 53-59 $schema->storage->txn_begin(); Link Here
53
my $builder = t::lib::TestBuilder->new();
53
my $builder = t::lib::TestBuilder->new();
54
54
55
my $dbh = C4::Context->dbh;
55
my $dbh = C4::Context->dbh;
56
$dbh->{RaiseError} = 1;
57
56
58
$dbh->do(q|DELETE FROM letter|);
57
$dbh->do(q|DELETE FROM letter|);
59
58
(-)a/t/db_dependent/Members/Attributes.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(q|DELETE FROM issues|);
37
$dbh->do(q|DELETE FROM issues|);
39
$dbh->do(q|DELETE FROM borrowers|);
38
$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/Reports/Guided.t (+1 lines)
Lines 256-261 subtest 'get_saved_reports' => sub { Link Here
256
        defined($errors) && exists($errors->{queryerr}),
256
        defined($errors) && exists($errors->{queryerr}),
257
        'attempting to run a report with an SQL syntax error returns error message (Bug 12214)'
257
        'attempting to run a report with an SQL syntax error returns error message (Bug 12214)'
258
    );
258
    );
259
    $dbh->{RaiseError} = 0;
259
260
260
    is_deeply( get_report_areas(), [ 'CIRC', 'CAT', 'PAT', 'ACQ', 'ACC', 'SER' ],
261
    is_deeply( get_report_areas(), [ 'CIRC', 'CAT', 'PAT', 'ACQ', 'ACC', 'SER' ],
261
        "get_report_areas returns the correct array of report areas");
262
        "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 (-2 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|);
26
- 

Return to bug 22001