Lines 33-38
use Koha::Exceptions::Patron::Attribute;
Link Here
|
33 |
use Koha::Patron::Attributes; |
33 |
use Koha::Patron::Attributes; |
34 |
use Koha::Patron::Debarments qw/AddDebarment/; |
34 |
use Koha::Patron::Debarments qw/AddDebarment/; |
35 |
|
35 |
|
|
|
36 |
use JSON qw(encode_json); |
37 |
|
36 |
my $schema = Koha::Database->new->schema; |
38 |
my $schema = Koha::Database->new->schema; |
37 |
my $builder = t::lib::TestBuilder->new; |
39 |
my $builder = t::lib::TestBuilder->new; |
38 |
|
40 |
|
Lines 87-93
subtest 'list() tests' => sub {
Link Here
|
87 |
|
89 |
|
88 |
subtest 'searching date and date-time fields' => sub { |
90 |
subtest 'searching date and date-time fields' => sub { |
89 |
|
91 |
|
90 |
plan tests => 6; |
92 |
plan tests => 12; |
91 |
|
93 |
|
92 |
my $date_of_birth = '1980-06-18'; |
94 |
my $date_of_birth = '1980-06-18'; |
93 |
my $last_seen = '2021-06-25 14:05:35'; |
95 |
my $last_seen = '2021-06-25 14:05:35'; |
Lines 111-116
subtest 'list() tests' => sub {
Link Here
|
111 |
$t->get_ok("//$userid:$password@/api/v1/patrons?last_seen=" . $last_seen_rfc3339 . "&cardnumber=" . $patron->cardnumber) |
113 |
$t->get_ok("//$userid:$password@/api/v1/patrons?last_seen=" . $last_seen_rfc3339 . "&cardnumber=" . $patron->cardnumber) |
112 |
->status_is(200) |
114 |
->status_is(200) |
113 |
->json_is( '/0/patron_id' => $patron->id, 'Filtering by date-time works' ); |
115 |
->json_is( '/0/patron_id' => $patron->id, 'Filtering by date-time works' ); |
|
|
116 |
|
117 |
my $q = encode_json( |
118 |
{ |
119 |
date_of_birth => $date_of_birth, |
120 |
cardnumber => $patron->cardnumber, |
121 |
} |
122 |
); |
123 |
|
124 |
$t->get_ok("//$userid:$password@/api/v1/patrons?q=$q") |
125 |
->status_is(200) |
126 |
->json_is( '/0/patron_id' => $patron->id, 'Filtering by date works' ); |
127 |
|
128 |
$q = encode_json( |
129 |
{ |
130 |
last_seen => $last_seen_rfc3339, |
131 |
cardnumber => $patron->cardnumber, |
132 |
} |
133 |
); |
134 |
|
135 |
$t->get_ok("//$userid:$password@/api/v1/patrons?q=$q") |
136 |
->status_is(200) |
137 |
->json_is( '/0/patron_id' => $patron->id, 'Filtering by date-time works' ); |
114 |
}; |
138 |
}; |
115 |
|
139 |
|
116 |
$schema->storage->txn_rollback; |
140 |
$schema->storage->txn_rollback; |
117 |
- |
|
|