| Lines 18-24
          
      
      
        Link Here | 
        
          | 18 | use Modern::Perl; | 18 | use Modern::Perl; | 
        
          | 19 | use utf8; | 19 | use utf8; | 
        
          | 20 |  | 20 |  | 
          
            
              | 21 | use Test::More tests => 52; | 21 | use Test::More tests => 53; | 
        
          | 22 | use Test::Exception; | 22 | use Test::Exception; | 
        
          | 23 | use Test::MockModule; | 23 | use Test::MockModule; | 
        
          | 24 | use Test::Deep qw( cmp_deeply ); | 24 | use Test::Deep qw( cmp_deeply ); | 
  
    | Lines 4738-4743
          subtest 'AddIssue records staff who checked out item if appropriate' => sub  {
      
      
        Link Here | 
        
          | 4738 |     is( $issue->issuer, $issuer->{borrowernumber}, "Staff who checked out the item recorded when RecordStaffUserOnCheckout turned on" ); | 4738 |     is( $issue->issuer, $issuer->{borrowernumber}, "Staff who checked out the item recorded when RecordStaffUserOnCheckout turned on" ); | 
        
          | 4739 | }; | 4739 | }; | 
        
          | 4740 |  | 4740 |  | 
            
              |  |  | 4741 | subtest "Item's onloan value should be set if checked out item is checked out to a different patron" => sub { | 
            
              | 4742 |     plan tests => 2; | 
            
              | 4743 |  | 
            
              | 4744 |     my $library_1 = $builder->build_object( { class => 'Koha::Libraries' } ); | 
            
              | 4745 |     my $patron_1 = $builder->build_object( | 
            
              | 4746 |         { | 
            
              | 4747 |             class => 'Koha::Patrons', | 
            
              | 4748 |             value => { branchcode => $library_1->branchcode } | 
            
              | 4749 |         } | 
            
              | 4750 |     ); | 
            
              | 4751 |     my $patron_2 = $builder->build_object( | 
            
              | 4752 |         { | 
            
              | 4753 |             class => 'Koha::Patrons', | 
            
              | 4754 |             value => { branchcode => $library_1->branchcode } | 
            
              | 4755 |         } | 
            
              | 4756 |     ); | 
            
              | 4757 |  | 
            
              | 4758 |     my $item = $builder->build_sample_item( | 
            
              | 4759 |         { | 
            
              | 4760 |             library => $library_1->branchcode, | 
            
              | 4761 |         } | 
            
              | 4762 |     ); | 
            
              | 4763 |  | 
            
              | 4764 |     AddIssue( $patron_1->unblessed, $item->barcode ); | 
            
              | 4765 |     ok( $item->get_from_storage->onloan, "Item's onloan column is set after initial checkout" ); | 
            
              | 4766 |     AddIssue( $patron_2->unblessed, $item->barcode ); | 
            
              | 4767 |     ok( $item->get_from_storage->onloan, "Item's onloan column is set after second checkout" ); | 
            
              | 4768 | }; | 
            
              | 4769 |  | 
        
          | 4741 | $schema->storage->txn_rollback; | 4770 | $schema->storage->txn_rollback; | 
        
          | 4742 | C4::Context->clear_syspref_cache(); | 4771 | C4::Context->clear_syspref_cache(); | 
        
          | 4743 | $branches = Koha::Libraries->search(); | 4772 | $branches = Koha::Libraries->search(); | 
            
              | 4744 | -  |  |  |