Lines 17-23
Link Here
|
17 |
|
17 |
|
18 |
use Modern::Perl; |
18 |
use Modern::Perl; |
19 |
|
19 |
|
20 |
use Test::More tests => 27; |
20 |
use Test::More tests => 29; |
21 |
|
21 |
|
22 |
use C4::Context; |
22 |
use C4::Context; |
23 |
use C4::Members; |
23 |
use C4::Members; |
Lines 61-67
my %john_doe = (
Link Here
|
61 |
surname => 'Doe', |
61 |
surname => 'Doe', |
62 |
categorycode => $categorycode, |
62 |
categorycode => $categorycode, |
63 |
branchcode => $branchcode, |
63 |
branchcode => $branchcode, |
64 |
dateofbirth => '', |
64 |
dateofbirth => '2010-10-15', |
65 |
dateexpiry => '9999-12-31', |
65 |
dateexpiry => '9999-12-31', |
66 |
userid => 'john.doe' |
66 |
userid => 'john.doe' |
67 |
); |
67 |
); |
Lines 72-78
my %john_smith = (
Link Here
|
72 |
surname => 'Smith', |
72 |
surname => 'Smith', |
73 |
categorycode => $categorycode, |
73 |
categorycode => $categorycode, |
74 |
branchcode => $branchcode, |
74 |
branchcode => $branchcode, |
75 |
dateofbirth => '', |
75 |
dateofbirth => '2010-01-31', |
76 |
dateexpiry => '9999-12-31', |
76 |
dateexpiry => '9999-12-31', |
77 |
userid => 'john.smith' |
77 |
userid => 'john.smith' |
78 |
); |
78 |
); |
Lines 363-368
$search_results = C4::Utils::DataTables::Members::search({
Link Here
|
363 |
is( $search_results->{ iTotalDisplayRecords }, 1, |
363 |
is( $search_results->{ iTotalDisplayRecords }, 1, |
364 |
"Jean Paul Dupont is found using contains and two terms search 'Jea Pau' (Bug 15252)"); |
364 |
"Jean Paul Dupont is found using contains and two terms search 'Jea Pau' (Bug 15252)"); |
365 |
|
365 |
|
|
|
366 |
# Date of birth formatting |
367 |
t::lib::Mocks::mock_preference('dateformat', 'metric'); |
368 |
$search_results = C4::Utils::DataTables::Members::search({ |
369 |
searchmember => "15/10/2010", |
370 |
searchfieldstype => 'dateofbirth', |
371 |
dt_params => \%dt_params |
372 |
}); |
373 |
is( $search_results->{ iTotalDisplayRecords }, 1, |
374 |
"Sarching by date of birth should handle date formatted given the dateformat pref"); |
375 |
$search_results = C4::Utils::DataTables::Members::search({ |
376 |
searchmember => "2010-10-15", |
377 |
searchfieldstype => 'dateofbirth', |
378 |
dt_params => \%dt_params |
379 |
}); |
380 |
is( $search_results->{ iTotalDisplayRecords }, 1, |
381 |
"Sarching by date of birth should handle date formatted in iso"); |
382 |
|
366 |
# End |
383 |
# End |
367 |
$dbh->rollback; |
384 |
$dbh->rollback; |
368 |
|
385 |
|
369 |
- |
|
|