Bugzilla – Attachment 56021 Details for
Bug 17375
Prevent internal software error when searching patron with invalid birth date
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17375: Search by dateofbirth - Add tests
Bug-17375-Search-by-dateofbirth---Add-tests.patch (text/plain), 2.18 KB, created by
Jonathan Druart
on 2016-10-04 10:59:31 UTC
(
hide
)
Description:
Bug 17375: Search by dateofbirth - Add tests
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2016-10-04 10:59:31 UTC
Size:
2.18 KB
patch
obsolete
>From ad82cedc5e882c766e3f97eba128ab062a13edf1 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 4 Oct 2016 11:55:02 +0100 >Subject: [PATCH] Bug 17375: Search by dateofbirth - Add tests > >--- > t/db_dependent/Utils/Datatables_Members.t | 23 ++++++++++++++++++++--- > 1 file changed, 20 insertions(+), 3 deletions(-) > >diff --git a/t/db_dependent/Utils/Datatables_Members.t b/t/db_dependent/Utils/Datatables_Members.t >index acef35b..8cb7cc2 100644 >--- a/t/db_dependent/Utils/Datatables_Members.t >+++ b/t/db_dependent/Utils/Datatables_Members.t >@@ -17,7 +17,7 @@ > > use Modern::Perl; > >-use Test::More tests => 27; >+use Test::More tests => 29; > > use C4::Context; > use C4::Members; >@@ -61,7 +61,7 @@ my %john_doe = ( > surname => 'Doe', > categorycode => $categorycode, > branchcode => $branchcode, >- dateofbirth => '', >+ dateofbirth => '2010-10-15', > dateexpiry => '9999-12-31', > userid => 'john.doe' > ); >@@ -72,7 +72,7 @@ my %john_smith = ( > surname => 'Smith', > categorycode => $categorycode, > branchcode => $branchcode, >- dateofbirth => '', >+ dateofbirth => '2010-01-31', > dateexpiry => '9999-12-31', > userid => 'john.smith' > ); >@@ -363,6 +363,23 @@ $search_results = C4::Utils::DataTables::Members::search({ > is( $search_results->{ iTotalDisplayRecords }, 1, > "Jean Paul Dupont is found using contains and two terms search 'Jea Pau' (Bug 15252)"); > >+# Date of birth formatting >+t::lib::Mocks::mock_preference('dateformat', 'metric'); >+$search_results = C4::Utils::DataTables::Members::search({ >+ searchmember => "15/10/2010", >+ searchfieldstype => 'dateofbirth', >+ dt_params => \%dt_params >+}); >+is( $search_results->{ iTotalDisplayRecords }, 1, >+ "Sarching by date of birth should handle date formatted given the dateformat pref"); >+$search_results = C4::Utils::DataTables::Members::search({ >+ searchmember => "2010-10-15", >+ searchfieldstype => 'dateofbirth', >+ dt_params => \%dt_params >+}); >+is( $search_results->{ iTotalDisplayRecords }, 1, >+ "Sarching by date of birth should handle date formatted in iso"); >+ > # End > $dbh->rollback; > >-- >2.8.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 17375
:
55923
|
55986
|
56021
|
56022
|
56024
|
56025
|
56685
|
56918
|
56919