Bug 20144: [sql_modes] Shorten cities.city_zipcode
[koha.git] / t / db_dependent / Koha / Checkouts.t
index ba85bb2..c8ec4c5 100644 (file)
@@ -19,7 +19,7 @@
 
 use Modern::Perl;
 
-use Test::More tests => 5;
+use Test::More tests => 7;
 
 use Koha::Checkouts;
 use Koha::Database;
@@ -86,9 +86,22 @@ subtest 'is_overdue' => sub {
         0, 'In Ten days, the item due yesterday will still be late' );
 };
 
+subtest 'item' => sub {
+    plan tests => 2;
+    my $item = $retrieved_checkout_1->item;
+    is( ref( $item ), 'Koha::Item', 'Koha::Checkout->item should return a Koha::Item' );
+    is( $item->itemnumber, $item_1->{itemnumber}, 'Koha::Checkout->item should return the correct item' );
+};
+
+subtest 'patron' => sub {
+    plan tests => 2;
+    my $p = $new_checkout_1->patron;
+    is( ref($p), 'Koha::Patron', 'Koha::Checkout->patron should return a Koha::Patron' );
+    is( $p->borrowernumber, $patron->{borrowernumber}, 'Koha::Checkout->patron should return the correct patron' );
+};
+
 $retrieved_checkout_1->delete;
 is( Koha::Checkouts->search->count, $nb_of_checkouts + 1, 'Delete should have deleted the checkout' );
 
 $schema->storage->txn_rollback;
 
-1;