| 
      
            Lines 40-46
          use C4::Biblio qw( AddBiblio ); # We shouldn't use it
      
      
        Link Here
      
     | 
  
        
          | 40 | 
           | 
          40 | 
           | 
        
        
          | 41 | 
          use Koha::CirculationRules;  | 
          41 | 
          use Koha::CirculationRules;  | 
        
        
          | 42 | 
           | 
          42 | 
           | 
        
          
            
              | 43 | 
              use Test::More tests => 20;  | 
              43 | 
              use Test::More tests => 22;  | 
            
        
          | 44 | 
          use MARC::Record;  | 
          44 | 
          use MARC::Record;  | 
        
        
          | 45 | 
          use MARC::Field;  | 
          45 | 
          use MARC::Field;  | 
        
        
          | 46 | 
           | 
          46 | 
           | 
        
  
    | 
      
            Lines 77-82
          our $sample_data = {
      
      
        Link Here
      
     | 
  
        
          | 77 | 
                  issuelength   => '5',  | 
          77 | 
                  issuelength   => '5',  | 
        
        
          | 78 | 
                  lengthunit    => 'days',  | 
          78 | 
                  lengthunit    => 'days',  | 
        
        
          | 79 | 
                  renewalperiod => '5',  | 
          79 | 
                  renewalperiod => '5',  | 
        
            
               | 
               | 
              80 | 
                      reservesallowed => '5',  | 
            
            
              | 81 | 
                      onshelfholds  => '1',  | 
            
            
              | 82 | 
                      opacitemholds => 'Y',  | 
            
        
          | 80 | 
                },  | 
          83 | 
                },  | 
        
        
          | 81 | 
          };  | 
          84 | 
          };  | 
        
        
          | 82 | 
          our ( $borrowernumber, $start, $prev_time, $cleanup_needed );  | 
          85 | 
          our ( $borrowernumber, $start, $prev_time, $cleanup_needed );  | 
        
  
    | 
      
            Lines 85-91
          $dbh->do(q|INSERT INTO itemtypes(itemtype) VALUES (?)|, undef, $sample_data->{it
      
      
        Link Here
      
     | 
  
        
          | 85 | 
           | 
          88 | 
           | 
        
        
          | 86 | 
          SKIP: { | 
          89 | 
          SKIP: { | 
        
        
          | 87 | 
              eval { require Selenium::Remote::Driver; }; | 
          90 | 
              eval { require Selenium::Remote::Driver; }; | 
        
          
            
              | 88 | 
                  skip "Selenium::Remote::Driver is needed for selenium tests.", 20 if $@;  | 
              91 | 
                  skip "Selenium::Remote::Driver is needed for selenium tests.", 22 if $@;  | 
            
        
          | 89 | 
           | 
          92 | 
           | 
        
        
          | 90 | 
              $cleanup_needed = 1;  | 
          93 | 
              $cleanup_needed = 1;  | 
        
        
          | 91 | 
           | 
          94 | 
           | 
        
  
    | 
      
            Lines 155-166
          SKIP: {
      
      
        Link Here
      
     | 
  
        
          | 155 | 
                      categorycode => $issuing_rules->{categorycode}, | 
          158 | 
                      categorycode => $issuing_rules->{categorycode}, | 
        
        
          | 156 | 
                      itemtype     => $issuing_rules->{itemtype}, | 
          159 | 
                      itemtype     => $issuing_rules->{itemtype}, | 
        
        
          | 157 | 
                      branchcode   => $issuing_rules->{branchcode}, | 
          160 | 
                      branchcode   => $issuing_rules->{branchcode}, | 
        
          
            
              | 158 | 
                          rules        => { | 
              161 | 
                          rules => { | 
            
            
              | 159 | 
                              maxissueqty => $issuing_rules->{maxissueqty}, | 
              162 | 
                              maxissueqty     => $issuing_rules->{maxissueqty}, | 
            
            
              | 160 | 
                              issuelength => $issuing_rules->{issuelength}, | 
              163 | 
                              issuelength     => $issuing_rules->{issuelength}, | 
            
            
              | 161 | 
                              lengthunit => $issuing_rules->{lengthunit}, | 
              164 | 
                              lengthunit      => $issuing_rules->{lengthunit}, | 
            
            
              | 162 | 
                              renewalperiod => $issuing_rules->{renewalperiod}, | 
              165 | 
                              renewalperiod   => $issuing_rules->{renewalperiod}, | 
            
            
              | 163 | 
                          }  | 
              166 | 
                              reservesallowed => $issuing_rules->{reservesallowed}, | 
            
            
               | 
               | 
              167 | 
                              onshelfholds    => $issuing_rules->{onshelfholds}, | 
            
            
              | 168 | 
                              opacitemholds   => $issuing_rules->{opacitemholds}, | 
            
            
              | 169 | 
               | 
            
            
              | 170 | 
                            }  | 
            
        
          | 164 | 
                  }  | 
          171 | 
                  }  | 
        
        
          | 165 | 
              );  | 
          172 | 
              );  | 
        
        
          | 166 | 
           | 
          173 | 
           | 
        
  
    | 
      
            Lines 227-232
          SKIP: {
      
      
        Link Here
      
     | 
  
        
          | 227 | 
           | 
          234 | 
           | 
        
        
          | 228 | 
              time_diff("checkin"); | 
          235 | 
              time_diff("checkin"); | 
        
        
          | 229 | 
           | 
          236 | 
           | 
        
            
               | 
               | 
              237 | 
                  #Place holds  | 
            
            
              | 238 | 
                  $driver->get($base_url."/reserve/request.pl?borrowernumber=$borrowernumber&biblionumber=".$biblionumbers[0]);  | 
            
            
              | 239 | 
                  $driver->find_element('//form[@id="hold-request-form"]//input[@type="submit"]')->click; # Biblio level | 
            
            
              | 240 | 
                  my $patron = Koha::Patrons->find($borrowernumber);  | 
            
            
              | 241 | 
                  is( $patron->holds->count, 1, );  | 
            
            
              | 242 | 
               | 
            
            
              | 243 | 
                  $driver->get($base_url."/reserve/request.pl?borrowernumber=$borrowernumber&biblionumber=".$biblionumbers[1]);  | 
            
            
              | 244 | 
                  $driver->find_element('//form[@id="hold-request-form"]//input[@type="radio"]')->click; # Item level, there is only 1 item per bib so we are safe | 
            
            
              | 245 | 
                  $driver->find_element('//form[@id="hold-request-form"]//input[@type="submit"]')->click; | 
            
            
              | 246 | 
                  is( $patron->holds->count, 2, );  | 
            
            
              | 247 | 
               | 
            
            
              | 248 | 
                  time_diff("holds"); | 
            
            
              | 249 | 
               | 
            
        
          | 230 | 
              close $fh;  | 
          250 | 
              close $fh;  | 
        
        
          | 231 | 
              $driver->quit();  | 
          251 | 
              $driver->quit();  | 
        
        
          | 232 | 
          };  | 
          252 | 
          };  | 
        
            
              | 233 | 
              -   | 
               | 
               |