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

(-)a/t/db_dependent/CourseReserves.t (-2 / +23 lines)
Lines 5-11 Link Here
5
5
6
use Modern::Perl;
6
use Modern::Perl;
7
7
8
use Test::More tests => 21;
8
use Test::More tests => 26;
9
9
10
use Koha::Database;
10
use Koha::Database;
11
use t::lib::TestBuilder;
11
use t::lib::TestBuilder;
Lines 53-64 ok( $course_id, "ModCourse created course successfully" ); Link Here
53
$course_id = ModCourse(
53
$course_id = ModCourse(
54
    course_id  => $course_id,
54
    course_id  => $course_id,
55
    staff_note => "Test staff note 2",
55
    staff_note => "Test staff note 2",
56
    enabled   => 'no',
56
);
57
);
57
58
58
my $course = GetCourse($course_id);
59
my $course = GetCourse($course_id);
59
60
60
ok( $course->{'course_name'} eq "Test Course",       "GetCourse returned correct course" );
61
ok( $course->{'course_name'} eq "Test Course",       "GetCourse returned correct course" );
61
ok( $course->{'staff_note'}  eq "Test staff note 2", "ModCourse updated course succesfully" );
62
ok( $course->{'staff_note'}  eq "Test staff note 2", "ModCourse updated course succesfully" );
63
is( $course->{'enabled'}, 'no', "Test Course is disabled" );
62
64
63
my $courses = GetCourses();
65
my $courses = GetCourses();
64
is( ref($courses), 'ARRAY', "GetCourses returns an array" );
66
is( ref($courses), 'ARRAY', "GetCourses returns an array" );
Lines 87-92 ok( $course_reserve->{'cr_id'} eq $cr_id, "GetCourseReserve returns valid data" Link Here
87
my $course_reserves = GetCourseReserves( 'course_id' => $course_id );
89
my $course_reserves = GetCourseReserves( 'course_id' => $course_id );
88
ok( $course_reserves->[0]->{'ci_id'} eq $ci_id, "GetCourseReserves returns valid data." );
90
ok( $course_reserves->[0]->{'ci_id'} eq $ci_id, "GetCourseReserves returns valid data." );
89
91
92
## Check for regression of Bug 15530
93
$course_id = ModCourse(
94
    course_id  => $course_id,
95
    enabled   => 'yes',
96
);
97
$course = GetCourse($course_id);
98
is( $course->{'enabled'}, 'yes', "Test Course is enabled" );
99
$course_item = GetCourseItem( 'ci_id' => $ci_id );
100
is( $course_item->{enabled}, 'yes', "Course item is enabled after modding disabled course" );
101
my $disabled_course_id = ModCourse(
102
    course_name => "Disabled Course",
103
    enabled     => 'no',
104
);
105
my $disabled_course = GetCourse( $disabled_course_id );
106
is( $disabled_course->{'enabled'}, 'no', "Disabled Course is disabled" );
107
my $cr_id2 = ModCourseReserve( 'course_id' => $disabled_course_id, 'ci_id' => $ci_id );
108
$course_item = GetCourseItem( 'ci_id' => $ci_id );
109
is( $course_item->{enabled}, 'yes', "Course item is enabled after modding disabled course" );
110
## End check for regression of Bug 15530
111
90
my $info = GetItemCourseReservesInfo( itemnumber => $itemnumber );
112
my $info = GetItemCourseReservesInfo( itemnumber => $itemnumber );
91
ok( $info->[0]->{'itemnumber'} eq $itemnumber, "GetItemReservesInfo returns valid data." );
113
ok( $info->[0]->{'itemnumber'} eq $itemnumber, "GetItemReservesInfo returns valid data." );
92
114
93
- 

Return to bug 15530