Bug 18290: Fix t/db_dependent/Koha/Object.t, Mojo::JSON::Bool is a JSON::PP::Boolean :)
authorOlli-Antti Kivilahti <olli-antti.kivilahti@jns.fi>
Fri, 17 Mar 2017 06:09:05 +0000 (08:09 +0200)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Thu, 21 Sep 2017 14:27:06 +0000 (11:27 -0300)
Mojolicious 7.21 onwards, no longer returns Mojo::JSON::Bool-objects but JSON::PP instead.
Which might be pretty smart.

This version is required by bug 18137 and so this patch for the tests is
needed.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Tested along with 18137 and its dependencies (libs).

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
t/db_dependent/Koha/Object.t

index ea06544..a506b89 100755 (executable)
@@ -159,10 +159,10 @@ subtest 'TO_JSON tests' => sub {
     my $lost = $patron->TO_JSON()->{lost};
     my $gonenoaddress = $patron->TO_JSON->{gonenoaddress};
 
-    ok( $lost->isa('Mojo::JSON::_Bool'), 'Boolean attribute type is correct' );
+    ok( $lost->isa('JSON::PP::Boolean'), 'Boolean attribute type is correct' );
     is( $lost, 1, 'Boolean attribute value is correct (true)' );
 
-    ok( $gonenoaddress->isa('Mojo::JSON::_Bool'), 'Boolean attribute type is correct' );
+    ok( $gonenoaddress->isa('JSON::PP::Boolean'), 'Boolean attribute type is correct' );
     is( $gonenoaddress, 0, 'Boolean attribute value is correct (false)' );
 
     ok( !isvstring($patron->borrowernumber), 'Integer values are not coded as strings' );