Bugzilla – Attachment 19058 Details for
Bug 10332
UT: CourseReserves.t needs to create its own data
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 10332: Data could exist in the courses table.
Bug-10332-Data-could-exist-in-the-courses-table.patch (text/plain), 1.88 KB, created by
Jonathan Druart
on 2013-06-17 09:17:12 UTC
(
hide
)
Description:
Bug 10332: Data could exist in the courses table.
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2013-06-17 09:17:12 UTC
Size:
1.88 KB
patch
obsolete
>From af96835ea6d81af8b68cc855503232fe84fb3f8e Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Mon, 17 Jun 2013 11:16:10 +0200 >Subject: [PATCH] Bug 10332: Data could exist in the courses table. > >--- > C4/CourseReserves.pm | 1 + > t/db_dependent/CourseReserves.t | 8 ++++---- > 2 files changed, 5 insertions(+), 4 deletions(-) > >diff --git a/C4/CourseReserves.pm b/C4/CourseReserves.pm >index c3e25e6..69724d1 100644 >--- a/C4/CourseReserves.pm >+++ b/C4/CourseReserves.pm >@@ -77,6 +77,7 @@ This module deals with course reserves. > sub GetCourse { > my ($course_id) = @_; > warn whoami() . "( $course_id )" if $DEBUG; >+ return unless $course_id; > > my $query = "SELECT * FROM courses WHERE course_id = ?"; > my $dbh = C4::Context->dbh; >diff --git a/t/db_dependent/CourseReserves.t b/t/db_dependent/CourseReserves.t >index a7955e4..e27712a 100755 >--- a/t/db_dependent/CourseReserves.t >+++ b/t/db_dependent/CourseReserves.t >@@ -5,8 +5,7 @@ > > use Modern::Perl; > >-use Test::More tests => 20; >-use Data::Dumper; >+use Test::More tests => 21; > > BEGIN { > use_ok('C4::Biblio'); >@@ -46,12 +45,13 @@ $course_id = ModCourse( > ); > > 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" ); > > my $courses = GetCourses(); >-ok( $courses->[0]->{'course_name'} eq "Test Course", "GetCourses returns valid array of course data" ); >+is( ref($courses), 'ARRAY', "GetCourses returns an array" ); >+my @match = map {$_->{course_name} eq 'Test Course'} @$courses; >+ok( scalar(@match) > 0, "GetCourses returns valid array of course data" ); > > ModCourseInstructors( mode => 'add', course_id => $course_id, borrowernumbers => [ $borrowers[0]->{'borrowernumber'} ] ); > $course = GetCourse($course_id); >-- >1.7.10.4
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 10332
:
18382
|
18638
|
18645
|
19058
|
19059
|
19077
|
19078
|
19127
|
19128
|
19129
|
19135