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

(-)a/t/db_dependent/CourseReserves.t (-7 / +7 lines)
Lines 11-23 BEGIN { Link Here
11
    use_ok('C4::Biblio');
11
    use_ok('C4::Biblio');
12
    use_ok('C4::Context');
12
    use_ok('C4::Context');
13
    use_ok('C4::CourseReserves', qw/:all/);
13
    use_ok('C4::CourseReserves', qw/:all/);
14
    use_ok('C4::Items', qw(AddItemFromMarc));
14
    use_ok('C4::Items', qw(AddItem));
15
    use_ok('MARC::Field');
15
    use_ok('MARC::Field');
16
    use_ok('MARC::Record');
16
    use_ok('MARC::Record');
17
}
17
}
18
18
19
my $dbh = C4::Context->dbh;
19
my $dbh = C4::Context->dbh;
20
20
21
# Start transaction
22
$dbh->{AutoCommit} = 0;
23
$dbh->{RaiseError} = 1;
24
21
my $sth = $dbh->prepare("SELECT * FROM borrowers ORDER BY RAND() LIMIT 10");
25
my $sth = $dbh->prepare("SELECT * FROM borrowers ORDER BY RAND() LIMIT 10");
22
$sth->execute();
26
$sth->execute();
23
my @borrowers = @{ $sth->fetchall_arrayref( {} ) };
27
my @borrowers = @{ $sth->fetchall_arrayref( {} ) };
Lines 28-34 $record->append_fields( Link Here
28
    MARC::Field->new( '952', '0', '0', a => 'CPL', b => 'CPL' )
32
    MARC::Field->new( '952', '0', '0', a => 'CPL', b => 'CPL' )
29
);
33
);
30
my ( $biblionumber, $biblioitemnumber ) = C4::Biblio::AddBiblio($record, '');
34
my ( $biblionumber, $biblioitemnumber ) = C4::Biblio::AddBiblio($record, '');
31
my @iteminfo = C4::Items::AddItemFromMarc( $record, $biblionumber );
35
my @iteminfo = C4::Items::AddItem( { homebranch => 'CPL', holdingbranch => 'CPL' }, $biblionumber );
32
my $itemnumber = $iteminfo[2];
36
my $itemnumber = $iteminfo[2];
33
37
34
my $course_id = ModCourse(
38
my $course_id = ModCourse(
Lines 87-93 DelCourse($course_id); Link Here
87
$course = GetCourse($course_id);
91
$course = GetCourse($course_id);
88
ok( !defined( $course->{'course_id'} ), "DelCourse deleted course successfully" );
92
ok( !defined( $course->{'course_id'} ), "DelCourse deleted course successfully" );
89
93
90
END {
94
$dbh->rollback;
91
    C4::Items::DelItem( $dbh, $biblionumber, $itemnumber );
92
    C4::Biblio::DelBiblio( $biblionumber );
93
};
94
- 

Return to bug 10332