Bugzilla – Attachment 47248 Details for
Bug 15530
Editing a course item via a disabled course disables it even if it is on other enabled courses
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15530 - Add Unit Test
Bug-15530---Add-Unit-Test.patch (text/plain), 2.61 KB, created by
Jonathan Druart
on 2016-01-25 11:42:06 UTC
(
hide
)
Description:
Bug 15530 - Add Unit Test
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2016-01-25 11:42:06 UTC
Size:
2.61 KB
patch
obsolete
>From bbf078b92c94839966814186d7901bb39302e36b Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Fri, 8 Jan 2016 17:00:18 +0000 >Subject: [PATCH] Bug 15530 - Add Unit Test > >Signed-off-by: Margaret Holt <mholt@bastyr.edu> > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > t/db_dependent/CourseReserves.t | 24 +++++++++++++++++++++++- > 1 file changed, 23 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/CourseReserves.t b/t/db_dependent/CourseReserves.t >index 33a320f..d893890 100755 >--- a/t/db_dependent/CourseReserves.t >+++ b/t/db_dependent/CourseReserves.t >@@ -5,7 +5,7 @@ > > use Modern::Perl; > >-use Test::More tests => 21; >+use Test::More tests => 26; > > use Koha::Database; > use t::lib::TestBuilder; >@@ -53,12 +53,14 @@ ok( $course_id, "ModCourse created course successfully" ); > $course_id = ModCourse( > course_id => $course_id, > staff_note => "Test staff note 2", >+ enabled => 'no', > ); > > my $course = GetCourse($course_id); > > ok( $course->{'course_name'} eq "Test Course", "GetCourse returned correct course" ); > ok( $course->{'staff_note'} eq "Test staff note 2", "ModCourse updated course succesfully" ); >+is( $course->{'enabled'}, 'no', "Test Course is disabled" ); > > my $courses = GetCourses(); > is( ref($courses), 'ARRAY', "GetCourses returns an array" ); >@@ -87,6 +89,26 @@ ok( $course_reserve->{'cr_id'} eq $cr_id, "GetCourseReserve returns valid data" > my $course_reserves = GetCourseReserves( 'course_id' => $course_id ); > ok( $course_reserves->[0]->{'ci_id'} eq $ci_id, "GetCourseReserves returns valid data." ); > >+## Check for regression of Bug 15530 >+$course_id = ModCourse( >+ course_id => $course_id, >+ enabled => 'yes', >+); >+$course = GetCourse($course_id); >+is( $course->{'enabled'}, 'yes', "Test Course is enabled" ); >+$course_item = GetCourseItem( 'ci_id' => $ci_id ); >+is( $course_item->{enabled}, 'yes', "Course item is enabled after modding disabled course" ); >+my $disabled_course_id = ModCourse( >+ course_name => "Disabled Course", >+ enabled => 'no', >+); >+my $disabled_course = GetCourse( $disabled_course_id ); >+is( $disabled_course->{'enabled'}, 'no', "Disabled Course is disabled" ); >+my $cr_id2 = ModCourseReserve( 'course_id' => $disabled_course_id, 'ci_id' => $ci_id ); >+$course_item = GetCourseItem( 'ci_id' => $ci_id ); >+is( $course_item->{enabled}, 'yes', "Course item is enabled after modding disabled course" ); >+## End check for regression of Bug 15530 >+ > my $info = GetItemCourseReservesInfo( itemnumber => $itemnumber ); > ok( $info->[0]->{'itemnumber'} eq $itemnumber, "GetItemReservesInfo returns valid data." ); > >-- >2.1.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 15530
:
46443
|
46444
|
46445
|
46446
|
46615
|
46616
| 47248 |
47249