Bug 21684: Fix Hold.t
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Tue, 7 Jan 2020 15:06:38 +0000 (16:06 +0100)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Tue, 7 Jan 2020 16:33:04 +0000 (16:33 +0000)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
t/db_dependent/Hold.t

index 2ba6f7b..674f58a 100755 (executable)
@@ -150,7 +150,7 @@ subtest "delete() tests" => sub {
 
     my $hold_object = Koha::Holds->find( $hold->{ reserve_id } );
     my $deleted = $hold_object->delete;
-    is( $deleted, 1, 'Koha::Hold->delete should return 1 if the hold has been correctly deleted' );
+    is( ref($deleted), 'Koha::Hold', 'Koha::Hold->delete should return the Koha::Hold object if the hold has been correctly deleted' );
     is( Koha::Holds->search({ reserve_id => $hold->{ reserve_id } })->count, 0,
         "Koha::Hold->delete should have deleted the hold" );
 
@@ -165,7 +165,7 @@ subtest "delete() tests" => sub {
 
     $hold_object = Koha::Holds->find( $hold->{ reserve_id } );
     $deleted = $hold_object->delete;
-    is( $deleted, 1, 'Koha::Hold->delete should return 1 if the hold has been correctly deleted' );
+    is( ref($deleted), 'Koha::Hold', 'Koha::Hold->delete should return a Koha::Hold object if the hold has been correctly deleted' );
     is( Koha::Holds->search({ reserve_id => $hold->{ reserve_id } })->count, 0,
         "Koha::Hold->delete should have deleted the hold" );