Lines 27-37
use C4::Circulation; # AddIssue
Link Here
|
27 |
use C4::Biblio; # AddBiblio |
27 |
use C4::Biblio; # AddBiblio |
28 |
|
28 |
|
29 |
use Koha::Database; |
29 |
use Koha::Database; |
|
|
30 |
|
31 |
use Koha::Acquisition::Orders; |
30 |
use Koha::DateUtils qw( dt_from_string ); |
32 |
use Koha::DateUtils qw( dt_from_string ); |
31 |
use Koha::Libraries; |
33 |
use Koha::Libraries; |
32 |
use Koha::Patrons; |
34 |
use Koha::Patrons; |
33 |
use Koha::ApiKeys; |
35 |
use Koha::ApiKeys; |
34 |
|
36 |
|
|
|
37 |
use JSON; |
35 |
use Scalar::Util qw( isvstring ); |
38 |
use Scalar::Util qw( isvstring ); |
36 |
use Try::Tiny; |
39 |
use Try::Tiny; |
37 |
|
40 |
|
Lines 164-170
subtest 'discard_changes' => sub {
Link Here
|
164 |
|
167 |
|
165 |
subtest 'TO_JSON tests' => sub { |
168 |
subtest 'TO_JSON tests' => sub { |
166 |
|
169 |
|
167 |
plan tests => 8; |
170 |
plan tests => 9; |
168 |
|
171 |
|
169 |
$schema->storage->txn_begin; |
172 |
$schema->storage->txn_begin; |
170 |
|
173 |
|
Lines 210-215
subtest 'TO_JSON tests' => sub {
Link Here
|
210 |
like( $updated_on, $rfc3999_regex, "Date-time $updated_on formatted correctly"); |
213 |
like( $updated_on, $rfc3999_regex, "Date-time $updated_on formatted correctly"); |
211 |
like( $lastseen, $rfc3999_regex, "Date-time $updated_on formatted correctly"); |
214 |
like( $lastseen, $rfc3999_regex, "Date-time $updated_on formatted correctly"); |
212 |
|
215 |
|
|
|
216 |
# Test JSON doesn't receive strings |
217 |
my $order = $builder->build_object({ class => 'Koha::Acquisition::Orders' }); |
218 |
$order = Koha::Acquisition::Orders->find( $order->ordernumber ); |
219 |
is_deeply( $order->TO_JSON, decode_json( encode_json( $order->TO_JSON ) ), 'Orders are similar' ); |
220 |
|
213 |
$schema->storage->txn_rollback; |
221 |
$schema->storage->txn_rollback; |
214 |
}; |
222 |
}; |
215 |
|
223 |
|
216 |
- |
|
|