Lines 10-16
use Test::More tests => 16;
Link Here
|
10 |
use Data::Dumper; |
10 |
use Data::Dumper; |
11 |
|
11 |
|
12 |
BEGIN { |
12 |
BEGIN { |
13 |
use_ok('C4::Context'); |
13 |
use_ok('C4::Context'); |
14 |
use_ok('C4::CourseReserves'); |
14 |
use_ok('C4::CourseReserves'); |
15 |
} |
15 |
} |
16 |
|
16 |
|
Lines 28-48
$sth->execute();
Link Here
|
28 |
my @items = @{$sth->fetchall_arrayref({})}; |
28 |
my @items = @{$sth->fetchall_arrayref({})}; |
29 |
|
29 |
|
30 |
my $course_id = ModCourse( |
30 |
my $course_id = ModCourse( |
31 |
course_name => "Test Course", |
31 |
course_name => "Test Course", |
32 |
staff_note => "Test staff note", |
32 |
staff_note => "Test staff note", |
33 |
public_note => "Test public note", |
33 |
public_note => "Test public note", |
34 |
); |
34 |
); |
35 |
|
35 |
|
36 |
ok( $course_id, "ModCourse created course successfully" ); |
36 |
ok( $course_id, "ModCourse created course successfully" ); |
37 |
|
37 |
|
38 |
$course_id = ModCourse( |
38 |
$course_id = ModCourse( |
39 |
course_id => $course_id, |
39 |
course_id => $course_id, |
40 |
staff_note => "Test staff note 2", |
40 |
staff_note => "Test staff note 2", |
41 |
); |
41 |
); |
42 |
|
42 |
|
43 |
my $course = GetCourse( $course_id ); |
43 |
my $course = GetCourse( $course_id ); |
44 |
|
44 |
|
45 |
ok( $course->{'course_name'} eq "Test Course", "GetCourse returned correct course" ); |
45 |
ok( $course->{'course_name'} eq "Test Course", "GetCourse returned correct course" ); |
46 |
ok( $course->{'staff_note'} eq "Test staff note 2", "ModCourse updated course succesfully" ); |
46 |
ok( $course->{'staff_note'} eq "Test staff note 2", "ModCourse updated course succesfully" ); |
47 |
|
47 |
|
48 |
my $courses = GetCourses(); |
48 |
my $courses = GetCourses(); |
49 |
- |
|
|