Lines 10-16
use YAML;
Link Here
|
10 |
use C4::Debug; |
10 |
use C4::Debug; |
11 |
use C4::SQLHelper qw(:all); |
11 |
use C4::SQLHelper qw(:all); |
12 |
|
12 |
|
13 |
use Test::More tests => 22; |
13 |
use Test::More tests => 20; |
14 |
|
14 |
|
15 |
use_ok('C4::SQLHelper'); |
15 |
use_ok('C4::SQLHelper'); |
16 |
|
16 |
|
Lines 50-61
$borrowers=SearchInTable("borrowers",["Valjean",{firstname=>"Jean"}],undef,undef
Link Here
|
50 |
ok(keys %{$$borrowers[0]} ==1, "Search In Table columns out limit"); |
50 |
ok(keys %{$$borrowers[0]} ==1, "Search In Table columns out limit"); |
51 |
$borrowers=SearchInTable("borrowers",["Valjean",{firstname=>"Jean"}],undef,undef,[qw(borrowernumber)],[qw(firstname surname title)]); |
51 |
$borrowers=SearchInTable("borrowers",["Valjean",{firstname=>"Jean"}],undef,undef,[qw(borrowernumber)],[qw(firstname surname title)]); |
52 |
ok(@$borrowers>0, "Search In Table columns out limit to borrowernumber AND filter firstname surname title"); |
52 |
ok(@$borrowers>0, "Search In Table columns out limit to borrowernumber AND filter firstname surname title"); |
53 |
$borrowers=SearchInTable("borrowers",["Valjean",{firstname=>"Jean"}],undef,undef,[qw(borrowernumber)],[qw(firstname title)]); |
|
|
54 |
ok(@$borrowers==0, "Search In Table columns filter firstname title limit Valjean not in other fields than surname "); |
55 |
$borrowers=SearchInTable("borrowers",["Val",{firstname=>"Jean"}],undef,undef,[qw(borrowernumber)],[qw(surname)],"start_with"); |
53 |
$borrowers=SearchInTable("borrowers",["Val",{firstname=>"Jean"}],undef,undef,[qw(borrowernumber)],[qw(surname)],"start_with"); |
56 |
ok(@$borrowers>0, "Search In Table columns filter surname Val on a wide search found "); |
54 |
ok(@$borrowers>0, "Search In Table columns filter surname Val on a wide search found "); |
57 |
$borrowers=SearchInTable("borrowers",["Val",{firstname=>"Jean"}],undef,undef,[qw(borrowernumber)],[qw(surname)],"exact"); |
|
|
58 |
ok(@$borrowers==0, "Search In Table columns filter surname Val in exact search not found "); |
59 |
$borrowers=eval{SearchInTable("borrowers",["Val",{member=>"Jean"}],undef,undef,[qw(borrowernumber)],[qw(firstname title)],"exact")}; |
55 |
$borrowers=eval{SearchInTable("borrowers",["Val",{member=>"Jean"}],undef,undef,[qw(borrowernumber)],[qw(firstname title)],"exact")}; |
60 |
ok(@$borrowers==0 && !($@), "Search In Table fails gracefully when no correct field passed in hash"); |
56 |
ok(@$borrowers==0 && !($@), "Search In Table fails gracefully when no correct field passed in hash"); |
61 |
$borrowers=eval{SearchInTable("borrowers",["Jea"],undef,undef,undef,[qw(firstname surname borrowernumber)],"start_with")}; |
57 |
$borrowers=eval{SearchInTable("borrowers",["Jea"],undef,undef,undef,[qw(firstname surname borrowernumber)],"start_with")}; |
62 |
- |
|
|