Bug 13853: (follow-up) unit tests
authorJonathan Druart <jonathan.druart@koha-community.org>
Thu, 2 Jul 2015 09:20:13 +0000 (10:20 +0100)
committerTomas Cohen Arazi <tomascohen@unc.edu.ar>
Tue, 11 Aug 2015 17:49:03 +0000 (14:49 -0300)
Specify the reference, we should receive Koha::Object.

Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
t/db_dependent/Items.t

index c644492..b1796bc 100755 (executable)
@@ -406,14 +406,14 @@ subtest 'Koha::Item(s) tests' => sub {
 
     # Get item.
     my $item = Koha::Items->find( $itemnumber );
-    ok( $item, "Got Koha::Item" );
+    is( ref($item), 'Koha::Item', "Got Koha::Item" );
 
     my $homebranch = $item->home_branch();
-    ok( $homebranch, "Got Koha::Branch from home_branch method" );
+    is( ref($homebranch), 'Koha::Branch', "Got Koha::Branch from home_branch method" );
     is( $homebranch->branchcode(), $branch1, "Home branch code matches homebranch" );
 
     my $holdingbranch = $item->holding_branch();
-    ok( $holdingbranch, "Got Koha::Branch from holding_branch method" );
+    is( ref($holdingbranch), 'Koha::Branch', "Got Koha::Branch from holding_branch method" );
     is( $holdingbranch->branchcode(), $branch2, "Home branch code matches holdingbranch" );
 };