Lines 161-167
subtest 'discard_changes' => sub {
Link Here
|
161 |
|
161 |
|
162 |
subtest 'TO_JSON tests' => sub { |
162 |
subtest 'TO_JSON tests' => sub { |
163 |
|
163 |
|
164 |
plan tests => 7; |
164 |
plan tests => 8; |
165 |
|
165 |
|
166 |
$schema->storage->txn_begin; |
166 |
$schema->storage->txn_begin; |
167 |
|
167 |
|
Lines 169-174
subtest 'TO_JSON tests' => sub {
Link Here
|
169 |
my $borrowernumber = $builder->build( |
169 |
my $borrowernumber = $builder->build( |
170 |
{ source => 'Borrower', |
170 |
{ source => 'Borrower', |
171 |
value => { lost => 1, |
171 |
value => { lost => 1, |
|
|
172 |
sms_provider_id => undef, |
172 |
gonenoaddress => 0, |
173 |
gonenoaddress => 0, |
173 |
updated_on => $dt, |
174 |
updated_on => $dt, |
174 |
lastseen => $dt, } })->{borrowernumber}; |
175 |
lastseen => $dt, } })->{borrowernumber}; |
Lines 185-190
subtest 'TO_JSON tests' => sub {
Link Here
|
185 |
ok( $gonenoaddress->isa('JSON::PP::Boolean'), 'Boolean attribute type is correct' ); |
186 |
ok( $gonenoaddress->isa('JSON::PP::Boolean'), 'Boolean attribute type is correct' ); |
186 |
is( $gonenoaddress, 0, 'Boolean attribute value is correct (false)' ); |
187 |
is( $gonenoaddress, 0, 'Boolean attribute value is correct (false)' ); |
187 |
|
188 |
|
|
|
189 |
is( $patron->TO_JSON->{sms_provider_id}, undef, 'Undef values should not be casted to 0' ); |
190 |
|
188 |
ok( !isvstring($patron->borrowernumber), 'Integer values are not coded as strings' ); |
191 |
ok( !isvstring($patron->borrowernumber), 'Integer values are not coded as strings' ); |
189 |
|
192 |
|
190 |
my $rfc3999_regex = qr/ |
193 |
my $rfc3999_regex = qr/ |
191 |
- |
|
|