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

(-)a/t/db_dependent/Suggestions.t (-2 / +22 lines)
Lines 20-25 use Modern::Perl; Link Here
20
use C4::Context;
20
use C4::Context;
21
use C4::Members;
21
use C4::Members;
22
use C4::Letters;
22
use C4::Letters;
23
use C4::Branch;
23
24
24
use Koha::DateUtils qw( dt_from_string );
25
use Koha::DateUtils qw( dt_from_string );
25
26
Lines 32-37 BEGIN { Link Here
32
}
33
}
33
34
34
my $dbh = C4::Context->dbh;
35
my $dbh = C4::Context->dbh;
36
my $sql;
35
37
36
# Start transaction
38
# Start transaction
37
$dbh->{AutoCommit} = 0;
39
$dbh->{AutoCommit} = 0;
Lines 39-45 $dbh->{RaiseError} = 1; Link Here
39
41
40
# Reset item types to only the default ones
42
# Reset item types to only the default ones
41
$dbh->do(q|DELETE FROM itemtypes;|);
43
$dbh->do(q|DELETE FROM itemtypes;|);
42
my $sql = "
44
$sql = "
43
INSERT INTO itemtypes (itemtype, description, rentalcharge, notforloan, imageurl, summary) VALUES
45
INSERT INTO itemtypes (itemtype, description, rentalcharge, notforloan, imageurl, summary) VALUES
44
('BK', 'Books',5,0,'bridge/book.gif',''),
46
('BK', 'Books',5,0,'bridge/book.gif',''),
45
('MX', 'Mixed Materials',5,0,'bridge/kit.gif',''),
47
('MX', 'Mixed Materials',5,0,'bridge/kit.gif',''),
Lines 57-62 $dbh->do(q|DELETE FROM letter|); Link Here
57
$dbh->do(q|DELETE FROM message_queue|);
59
$dbh->do(q|DELETE FROM message_queue|);
58
$dbh->do(q|INSERT INTO letter(module, code, content) VALUES ('suggestions', 'CHECKED', 'my content')|);
60
$dbh->do(q|INSERT INTO letter(module, code, content) VALUES ('suggestions', 'CHECKED', 'my content')|);
59
61
62
# Add CPL if missing.
63
if (not defined GetBranchDetail('CPL')) {
64
    ModBranch({add => 1, branchcode => 'CPL', branchname => 'Centerville'});
65
}
66
67
my $sth = $dbh->prepare("SELECT * FROM categories WHERE categorycode='S';");
68
$sth->execute();
69
if (!$sth->fetchrow_hashref) {
70
    $sql = "INSERT INTO categories
71
                (categorycode,description,enrolmentperiod,upperagelimit,
72
                 dateofbirthrequired,finetype,bulk,enrolmentfee,
73
                 overduenoticerequired,issuelimit,reservefee,category_type)
74
            VALUES
75
                ('S','Staff',99,999,
76
                 18,NULL,NULL,'0.000000',
77
                 0,NULL,'0.000000','S');";
78
    $dbh->do($sql);
79
}
80
60
my $member = {
81
my $member = {
61
    firstname => 'my firstname',
82
    firstname => 'my firstname',
62
    surname => 'my surname',
83
    surname => 'my surname',
63
- 

Return to bug 13457