Bugzilla – Attachment 3336 Details for
Bug 5880
C4/Koha.pm : adding two functions GetAuthorisedValueByCode and GetKohaImageurlFromAuthorisedValues
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Follow up patch
0001-Follow-up-for-bug-5880-Added-unit-tests-for-the-two-.patch (text/plain), 1.89 KB, created by
Julian Maurice
on 2011-03-17 11:32:29 UTC
(
hide
)
Description:
Follow up patch
Filename:
MIME Type:
Creator:
Julian Maurice
Created:
2011-03-17 11:32:29 UTC
Size:
1.89 KB
patch
obsolete
>From 8ae698a9583716fef10d318b871ccbf8e352c993 Mon Sep 17 00:00:00 2001 >From: Julian Maurice <julian.maurice@biblibre.com> >Date: Thu, 17 Mar 2011 12:26:20 +0100 >Subject: [PATCH] Follow up for bug 5880: Added unit tests for the two new subroutines > >--- > t/db_dependent/Koha.t | 39 +++++++++++++++++++++++++++++++++++++++ > 1 files changed, 39 insertions(+), 0 deletions(-) > create mode 100644 t/db_dependent/Koha.t > >diff --git a/t/db_dependent/Koha.t b/t/db_dependent/Koha.t >new file mode 100644 >index 0000000..bdbb348 >--- /dev/null >+++ b/t/db_dependent/Koha.t >@@ -0,0 +1,39 @@ >+#!/usr/bin/perl >+# >+# This is to test C4/Koha >+# It requires a working Koha database with the sample data >+ >+use strict; >+use warnings; >+use C4::Context; >+ >+use Test::More tests => 3; >+ >+BEGIN { >+ use_ok('C4::Koha'); >+} >+ >+my $data = { >+ category => 'CATEGORY', >+ authorised_value => 'AUTHORISED_VALUE', >+ lib => 'LIB', >+ lib_opac => 'LIBOPAC', >+ imageurl => 'IMAGEURL' >+}; >+ >+my $dbh = C4::Context->dbh; >+ >+# Insert an entry into authorised_value table >+my $query = "INSERT INTO authorised_values (category, authorised_value, lib, lib_opac, imageurl) VALUES (?,?,?,?,?);"; >+my $sth = $dbh->prepare($query); >+$sth->execute($data->{category}, $data->{authorised_value}, $data->{lib}, $data->{lib_opac}, $data->{imageurl}); >+ >+# Tests >+is ( GetAuthorisedValueByCode($data->{category}, $data->{authorised_value}), $data->{lib}, "GetAuthorisedValueByCode" ); >+is ( GetKohaImageurlFromAuthorisedValues($data->{category}, $data->{lib}), $data->{imageurl}, "GetKohaImageurlFromAuthorisedValues" ); >+ >+# Clean up >+$query = "DELETE FROM authorised_values WHERE category=? AND authorised_value=? AND lib=? AND lib_opac=? AND imageurl=?;"; >+$sth = $dbh->prepare($query); >+$sth->execute($data->{category}, $data->{authorised_value}, $data->{lib}, $data->{lib_opac}, $data->{imageurl}); >+ >-- >1.7.4.1 >
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 5880
:
3318
| 3336 |
3340
|
3399