Bugzilla – Attachment 45303 Details for
Bug 15252
Patron search on start with does not work with several terms
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15252 - UT
Bug-15252---UT.patch (text/plain), 3.48 KB, created by
Fridolin Somers
on 2015-12-02 07:48:31 UTC
(
hide
)
Description:
Bug 15252 - UT
Filename:
MIME Type:
Creator:
Fridolin Somers
Created:
2015-12-02 07:48:31 UTC
Size:
3.48 KB
patch
obsolete
>From ef189ed1cb0119ce41c5f47c8dac7991fe562126 Mon Sep 17 00:00:00 2001 >From: Fridolin Somers <fridolin.somers@biblibre.com> >Date: Wed, 25 Nov 2015 14:02:05 +0100 >Subject: [PATCH] Bug 15252 - UT > >--- > t/db_dependent/Utils/Datatables_Members.t | 60 ++++++++++++++++++++++++++++++- > 1 file changed, 59 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Utils/Datatables_Members.t b/t/db_dependent/Utils/Datatables_Members.t >index 9f8cda8..855d129 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 => 15; >+use Test::More tests => 19; > > use C4::Context; > use C4::Branch; >@@ -87,12 +87,25 @@ my %jane_doe = ( > userid => 'jane.doe' > ); > >+my %jeanpaul_dupont = ( >+ cardnumber => '456789', >+ firstname => 'Jean Paul', >+ surname => 'Dupont', >+ categorycode => $categorycode, >+ branchcode => $branchcode, >+ dateofbirth => '', >+ dateexpiry => '9999-12-31', >+ userid => 'jeanpaul.dupont' >+); >+ > $john_doe{borrowernumber} = AddMember( %john_doe ); > warn "Error adding John Doe, check your tests" unless $john_doe{borrowernumber}; > $john_smith{borrowernumber} = AddMember( %john_smith ); > warn "Error adding John Smith, check your tests" unless $john_smith{borrowernumber}; > $jane_doe{borrowernumber} = AddMember( %jane_doe ); > warn "Error adding Jane Doe, check your tests" unless $jane_doe{borrowernumber}; >+$jeanpaul_dupont{borrowernumber} = AddMember( %jeanpaul_dupont ); >+warn "Error adding Jean Paul Dupont, check your tests" unless $jeanpaul_dupont{borrowernumber}; > > # Set common datatables params > my %dt_params = ( >@@ -228,6 +241,51 @@ $search_results = C4::Utils::DataTables::Members::search({ > }); > is( $search_results->{ iTotalDisplayRecords}, 0, "There are still 2 common users, but the patron attribute is not searchable " ); > >+$search_results = C4::Utils::DataTables::Members::search({ >+ searchmember => "Jean Paul", >+ searchfieldstype => 'standard', >+ searchtype => 'start_with', >+ branchcode => $branchcode, >+ dt_params => \%dt_params >+}); >+ >+is( $search_results->{ iTotalDisplayRecords }, 1, >+ "Jean Paul Dupont is found using start with and two terms search 'Jean Paul' (Bug 15252)"); >+ >+$search_results = C4::Utils::DataTables::Members::search({ >+ searchmember => "Jean Pau", >+ searchfieldstype => 'standard', >+ searchtype => 'start_with', >+ branchcode => $branchcode, >+ dt_params => \%dt_params >+}); >+ >+is( $search_results->{ iTotalDisplayRecords }, 1, >+ "Jean Paul Dupont is found using start with and two terms search 'Jean Pau' (Bug 15252)"); >+ >+$search_results = C4::Utils::DataTables::Members::search({ >+ searchmember => "Jea Pau", >+ searchfieldstype => 'standard', >+ searchtype => 'start_with', >+ branchcode => $branchcode, >+ dt_params => \%dt_params >+}); >+ >+is( $search_results->{ iTotalDisplayRecords }, 0, >+ "Jean Paul Dupont is not found using start with and two terms search 'Jea Pau' (Bug 15252)"); >+ >+$search_results = C4::Utils::DataTables::Members::search({ >+ searchmember => "Jea Pau", >+ searchfieldstype => 'standard', >+ searchtype => 'contain', >+ branchcode => $branchcode, >+ dt_params => \%dt_params >+}); >+ >+is( $search_results->{ iTotalDisplayRecords }, 1, >+ "Jean Paul Dupont is found using contains and two terms search 'Jea Pau' (Bug 15252)"); >+ >+# End > $dbh->rollback; > > 1; >-- >2.1.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 15252
:
45131
|
45132
|
45133
|
45134
|
45300
|
45301
|
45302
|
45303
|
45390
|
45391
|
45392
|
45393
|
45395
|
45401
|
45403
|
45405
|
45406
|
45407
|
45735
|
45736
|
45737
|
45738
|
45830
|
45831