Bugzilla – Attachment 21170 Details for
Bug 9811
Patrons search improvements
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 9811: Add unit tests for C4::Utils::DT::Members
Bug-9811-Add-unit-tests-for-C4UtilsDTMembers.patch (text/plain), 1.83 KB, created by
Jonathan Druart
on 2013-09-18 11:47:12 UTC
(
hide
)
Description:
Bug 9811: Add unit tests for C4::Utils::DT::Members
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2013-09-18 11:47:12 UTC
Size:
1.83 KB
patch
obsolete
>From 5db1151d7cae5176591467c6d68c9f62fa87a01d Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Thu, 28 Mar 2013 11:19:39 +0100 >Subject: [PATCH] Bug 9811: Add unit tests for C4::Utils::DT::Members > >Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> >--- > C4/Utils/DataTables/Members.pm | 9 ++++++++- > t/DataTables/Members.t | 14 ++++++++++++++ > 2 files changed, 22 insertions(+), 1 deletion(-) > create mode 100644 t/DataTables/Members.t > >diff --git a/C4/Utils/DataTables/Members.pm b/C4/Utils/DataTables/Members.pm >index b49a931..2f99d90 100644 >--- a/C4/Utils/DataTables/Members.pm >+++ b/C4/Utils/DataTables/Members.pm >@@ -91,7 +91,14 @@ sub search { > $limit = "LIMIT $dt_params->{iDisplayStart},$dt_params->{iDisplayLength}"; > } > >- my $query = join(" ", $select, $from, $where, $orderby, $limit); >+ my $query = join( >+ " ", >+ ($select ? $select : ""), >+ ($from ? $from : ""), >+ ($where ? $where : ""), >+ ($orderby ? $orderby : ""), >+ ($limit ? $limit : "") >+ ); > my $sth = $dbh->prepare($query); > $sth->execute(@where_args); > my $patrons = $sth->fetchall_arrayref({}); >diff --git a/t/DataTables/Members.t b/t/DataTables/Members.t >new file mode 100644 >index 0000000..942f93f >--- /dev/null >+++ b/t/DataTables/Members.t >@@ -0,0 +1,14 @@ >+use Modern::Perl; >+use Test::More tests => 4; >+ >+use_ok( "C4::Utils::DataTables::Members" ); >+ >+my $patrons = C4::Utils::DataTables::Members::search({ >+ searchmember => "Doe", >+ searchfieldstype => 'standard', >+ searchtype => 'contains' >+}); >+ >+isnt( $patrons->{iTotalDisplayRecords}, undef, "The iTotalDisplayRecords key is defined"); >+isnt( $patrons->{iTotalRecords}, undef, "The iTotalRecords key is defined"); >+is( ref $patrons->{patrons}, 'ARRAY', "The patrons key is an arrayref"); >-- >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 9811
:
16096
|
16111
|
16112
|
16320
|
16362
|
16403
|
16957
|
19056
|
19057
|
19307
|
19633
|
19642
|
20094
|
20095
|
20096
|
20174
|
20266
|
20290
|
20291
|
21169
|
21170
|
21171
|
21172
|
21173
|
21174
|
21175
|
22265
|
23261
|
24095
|
24111
|
26067
|
26068
|
26261
|
26336
|
26337
|
26342
|
26347
|
27642
|
27643
|
27644
|
27645
|
27646
|
27711
|
28738
|
28739
|
28740
|
28741
|
28742
|
28743
|
28744
|
28745
|
28746
|
28747
|
28781
|
28782
|
29019
|
29020
|
29021
|
29022
|
29023
|
29024
|
29025
|
29026
|
29027
|
29028
|
29029
|
29442