Bug 20287: Replace occurrences of AddMember with Koha::Patron->new->store->borrowernumber
[koha.git] / t / db_dependent / Members / IssueSlip.t
index c4d485a..cbf3a72 100644 (file)
@@ -119,7 +119,7 @@ my $itemnumber2 =
   AddItem( { barcode => $barcode2, %item_infos }, $biblionumber2 );
 
 my $borrowernumber =
-  AddMember( categorycode => $categorycode, branchcode => $branchcode );
+  Koha::Patron->new({ categorycode => $categorycode, branchcode => $branchcode })->store->borrowernumber;
 my $borrower = Koha::Patrons->find( $borrowernumber )->unblessed;
 
 my $module = new Test::MockModule('C4::Context');
@@ -161,6 +161,11 @@ EOS
         $issue_date = $yesterday_daily;
         AddIssue( $borrower, $barcode2, $date_due, undef, $issue_date );
 
+        # Set timestamps to the same value to avoid a different order
+        Koha::Checkouts->search(
+            { borrowernumber => $borrower->{borrowernumber} }
+        )->update( { timestamp => dt_from_string } );
+
         $expected_slip = <<EOS;
 Checked out: