| 
      
            Lines 5-10
          use 5.010;
      
      
        Link Here
      
     | 
  
        
          | 5 | 
          use C4::Context;  | 
          5 | 
          use C4::Context;  | 
        
        
          | 6 | 
          use C4::Circulation;  | 
          6 | 
          use C4::Circulation;  | 
        
        
          | 7 | 
          use C4::Members;  | 
          7 | 
          use C4::Members;  | 
        
            
               | 
               | 
              8 | 
              use C4::Items;  | 
            
        
          | 8 | 
           | 
          9 | 
           | 
        
        
          | 9 | 
          use Test::More tests => 8;  | 
          10 | 
          use Test::More tests => 8;  | 
        
        
          | 10 | 
          C4::Context->_new_userenv(1234567);  | 
          11 | 
          C4::Context->_new_userenv(1234567);  | 
        
  
    | 
      
            Lines 17-34
          my $test_item_fic = '502326000402';
      
      
        Link Here
      
     | 
  
        
          | 17 | 
          my $test_item_24 = '502326000404';  | 
          18 | 
          my $test_item_24 = '502326000404';  | 
        
        
          | 18 | 
          my $test_item_48 = '502326000403';  | 
          19 | 
          my $test_item_48 = '502326000403';  | 
        
        
          | 19 | 
           | 
          20 | 
           | 
        
          
            
              | 20 | 
              for my $item_barcode ( $test_item_fic, $test_item_24, $test_item_48) { | 
              21 | 
              my $borrower1 =  GetMember(cardnumber => $test_patron);  | 
            
            
              | 21 | 
                  my $duedate = try_issue($test_patron, $item_barcode);  | 
              22 | 
              my $item1 = GetItem (undef,$test_item_fic);  | 
            
            
              | 22 | 
                  isa_ok($duedate, 'DateTime');  | 
              23 | 
               | 
            
            
              | 23 | 
                  if ($item_barcode eq $test_item_fic) { | 
              24 | 
              SKIP: { | 
            
            
              | 24 | 
                      is($duedate->hour(), 23, "daily loan hours = 23");  | 
              25 | 
                  skip 'Missing test borrower or item, skipping tests', 8  | 
            
            
              | 25 | 
                      is($duedate->minute(), 59, "daily loan mins = 59");  | 
              26 | 
                    unless ( defined $borrower1 && defined $item1 );  | 
            
            
               | 
               | 
              27 | 
               | 
            
            
              | 28 | 
                  for my $item_barcode ( $test_item_fic, $test_item_24, $test_item_48 ) { | 
            
            
              | 29 | 
                      my $duedate = try_issue( $test_patron, $item_barcode );  | 
            
            
              | 30 | 
                      isa_ok( $duedate, 'DateTime' );  | 
            
            
              | 31 | 
                      if ( $item_barcode eq $test_item_fic ) { | 
            
            
              | 32 | 
                          is( $duedate->hour(),   23, "daily loan hours = 23" );  | 
            
            
              | 33 | 
                          is( $duedate->minute(), 59, "daily loan mins = 59" );  | 
            
            
              | 34 | 
                      }  | 
            
            
              | 35 | 
                      my $ret_ok = try_return($item_barcode);  | 
            
            
              | 36 | 
                      is( $ret_ok, 1, 'Return succeeded' );  | 
            
        
          | 26 | 
              }  | 
          37 | 
              }  | 
        
            
              | 27 | 
                  my $ret_ok = try_return($item_barcode);  | 
               | 
               | 
            
            
              | 28 | 
                  is($ret_ok, 1, 'Return succeeded');  | 
            
        
          | 29 | 
          }  | 
          38 | 
          }  | 
        
        
          | 30 | 
           | 
          39 | 
           | 
        
            
              | 31 | 
               | 
               | 
               | 
            
        
          | 32 | 
          sub try_issue { | 
          40 | 
          sub try_issue { | 
        
        
          | 33 | 
              my ($cardnumber, $item ) = @_;  | 
          41 | 
              my ($cardnumber, $item ) = @_;  | 
        
        
          | 34 | 
              my $issuedate = '2011-05-16';  | 
          42 | 
              my $issuedate = '2011-05-16';  | 
        
            
              | 35 | 
              -   | 
               | 
               |