Bugzilla – Attachment 105595 Details for
Bug 25638
API related tests failing on comparing floats
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 25638: Add tests for JSON conversion vs DBD::mysql
Bug-25638-Add-tests-for-JSON-conversion-vs-DBDmysq.patch (text/plain), 1.92 KB, created by
Tomás Cohen Arazi (tcohen)
on 2020-06-05 18:55:56 UTC
(
hide
)
Description:
Bug 25638: Add tests for JSON conversion vs DBD::mysql
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2020-06-05 18:55:56 UTC
Size:
1.92 KB
patch
obsolete
>From 01d149d2b1fde4b05d748b99d85be1b38fc2ff84 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Fri, 5 Jun 2020 15:44:39 -0300 >Subject: [PATCH] Bug 25638: Add tests for JSON conversion vs DBD::mysql > >We have the situation of needing to cast numbers so they are not >confused in JSON with strings by DBD::mysql returning them with the >wrong internal flags. > >We have also recently removed the cast, and adding it back now. >This test could help us detect this situation in case we make changes in >the area, and even on specific libraries versions. > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > t/db_dependent/Koha/Object.t | 10 +++++++++- > 1 file changed, 9 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Koha/Object.t b/t/db_dependent/Koha/Object.t >index c23f023cd4c..919472e8743 100755 >--- a/t/db_dependent/Koha/Object.t >+++ b/t/db_dependent/Koha/Object.t >@@ -27,11 +27,14 @@ use C4::Circulation; # AddIssue > use C4::Biblio; # AddBiblio > > use Koha::Database; >+ >+use Koha::Acquisition::Orders; > use Koha::DateUtils qw( dt_from_string ); > use Koha::Libraries; > use Koha::Patrons; > use Koha::ApiKeys; > >+use JSON; > use Scalar::Util qw( isvstring ); > use Try::Tiny; > >@@ -164,7 +167,7 @@ subtest 'discard_changes' => sub { > > subtest 'TO_JSON tests' => sub { > >- plan tests => 8; >+ plan tests => 9; > > $schema->storage->txn_begin; > >@@ -210,6 +213,11 @@ subtest 'TO_JSON tests' => sub { > like( $updated_on, $rfc3999_regex, "Date-time $updated_on formatted correctly"); > like( $lastseen, $rfc3999_regex, "Date-time $updated_on formatted correctly"); > >+ # Test JSON doesn't receive strings >+ my $order = $builder->build_object({ class => 'Koha::Acquisition::Orders' }); >+ $order = Koha::Acquisition::Orders->find( $order->ordernumber ); >+ is_deeply( $order->TO_JSON, decode_json( encode_json( $order->TO_JSON ) ), 'Orders are similar' ); >+ > $schema->storage->txn_rollback; > }; > >-- >2.27.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 25638
:
105484
|
105485
|
105582
|
105583
|
105590
| 105595 |
105596
|
105597
|
105598
|
105599
|
105665