Lines 5-12
Link Here
|
5 |
|
5 |
|
6 |
use Modern::Perl; |
6 |
use Modern::Perl; |
7 |
|
7 |
|
8 |
use Test::More tests => 20; |
8 |
use Test::More tests => 21; |
9 |
use Data::Dumper; |
|
|
10 |
|
9 |
|
11 |
BEGIN { |
10 |
BEGIN { |
12 |
use_ok('C4::Biblio'); |
11 |
use_ok('C4::Biblio'); |
Lines 46-57
$course_id = ModCourse(
Link Here
|
46 |
); |
45 |
); |
47 |
|
46 |
|
48 |
my $course = GetCourse($course_id); |
47 |
my $course = GetCourse($course_id); |
49 |
|
|
|
50 |
ok( $course->{'course_name'} eq "Test Course", "GetCourse returned correct course" ); |
48 |
ok( $course->{'course_name'} eq "Test Course", "GetCourse returned correct course" ); |
51 |
ok( $course->{'staff_note'} eq "Test staff note 2", "ModCourse updated course succesfully" ); |
49 |
ok( $course->{'staff_note'} eq "Test staff note 2", "ModCourse updated course succesfully" ); |
52 |
|
50 |
|
53 |
my $courses = GetCourses(); |
51 |
my $courses = GetCourses(); |
54 |
ok( $courses->[0]->{'course_name'} eq "Test Course", "GetCourses returns valid array of course data" ); |
52 |
is( ref($courses), 'ARRAY', "GetCourses returns an array" ); |
|
|
53 |
my @match = map {$_->{course_name} eq 'Test Course'} @$courses; |
54 |
ok( scalar(@match) > 0, "GetCourses returns valid array of course data" ); |
55 |
|
55 |
|
56 |
ModCourseInstructors( mode => 'add', course_id => $course_id, borrowernumbers => [ $borrowers[0]->{'borrowernumber'} ] ); |
56 |
ModCourseInstructors( mode => 'add', course_id => $course_id, borrowernumbers => [ $borrowers[0]->{'borrowernumber'} ] ); |
57 |
$course = GetCourse($course_id); |
57 |
$course = GetCourse($course_id); |
58 |
- |
|
|