| 
      
            Lines 20-25
          use Modern::Perl;
      
      
        Link Here
      
     | 
  
        
          | 20 | 
          use Test::More tests => 4;  | 
          20 | 
          use Test::More tests => 4;  | 
        
        
          | 21 | 
          use Test::Mojo;  | 
          21 | 
          use Test::Mojo;  | 
        
        
          | 22 | 
          use t::lib::TestBuilder;  | 
          22 | 
          use t::lib::TestBuilder;  | 
        
            
               | 
               | 
              23 | 
              use t::lib::Mocks;  | 
            
        
          | 23 | 
           | 
          24 | 
           | 
        
        
          | 24 | 
          use DateTime;  | 
          25 | 
          use DateTime;  | 
        
        
          | 25 | 
           | 
          26 | 
           | 
        
  
    | 
      
            Lines 31-41
          use Koha::Biblios;
      
      
        Link Here
      
     | 
  
        
          | 31 | 
          use Koha::Items;  | 
          32 | 
          use Koha::Items;  | 
        
        
          | 32 | 
          use Koha::Patrons;  | 
          33 | 
          use Koha::Patrons;  | 
        
        
          | 33 | 
           | 
          34 | 
           | 
        
            
               | 
               | 
              35 | 
              my $schema  = Koha::Database->new->schema;  | 
            
        
          | 34 | 
          my $builder = t::lib::TestBuilder->new();  | 
          36 | 
          my $builder = t::lib::TestBuilder->new();  | 
        
        
          | 35 | 
           | 
          37 | 
           | 
        
          
            
              | 36 | 
              my $dbh = C4::Context->dbh;  | 
              38 | 
              $schema->storage->txn_begin;  | 
            
            
              | 37 | 
              $dbh->{AutoCommit} = 0; | 
              39 | 
               | 
            
            
              | 38 | 
              $dbh->{RaiseError} = 1; | 
              40 | 
              # FIXME: sessionStorage defaults to mysql, but it seems to break transaction handling  | 
            
            
               | 
               | 
              41 | 
              # this affects the other REST api tests  | 
            
            
              | 42 | 
              t::lib::Mocks::mock_preference( 'SessionStorage', 'tmp' );  | 
            
        
          | 39 | 
           | 
          43 | 
           | 
        
        
          | 40 | 
          $ENV{REMOTE_ADDR} = '127.0.0.1'; | 
          44 | 
          $ENV{REMOTE_ADDR} = '127.0.0.1'; | 
        
        
          | 41 | 
          my $t = Test::Mojo->new('Koha::REST::V1'); | 
          45 | 
          my $t = Test::Mojo->new('Koha::REST::V1'); | 
        
  
    | 
      
            Lines 113-118
          my $itemnumber = create_item($biblionumber, 'TEST000001');
      
      
        Link Here
      
     | 
  
        
          | 113 | 
          my $biblionumber2 = create_biblio('RESTful Web APIs'); | 
          117 | 
          my $biblionumber2 = create_biblio('RESTful Web APIs'); | 
        
        
          | 114 | 
          my $itemnumber2 = create_item($biblionumber2, 'TEST000002');  | 
          118 | 
          my $itemnumber2 = create_item($biblionumber2, 'TEST000002');  | 
        
        
          | 115 | 
           | 
          119 | 
           | 
        
            
               | 
               | 
              120 | 
              my $dbh = C4::Context->dbh;  | 
            
        
          | 116 | 
          $dbh->do('DELETE FROM reserves'); | 
          121 | 
          $dbh->do('DELETE FROM reserves'); | 
        
        
          | 117 | 
          $dbh->do('DELETE FROM issuingrules'); | 
          122 | 
          $dbh->do('DELETE FROM issuingrules'); | 
        
        
          | 118 | 
              $dbh->do(q{ | 
          123 | 
              $dbh->do(q{ | 
        
  
    | 
      
            Lines 303-310
          subtest "Test endpoints with permission" => sub {
      
      
        Link Here
      
     | 
  
        
          | 303 | 
                ->json_like('/error', qr/tooManyReserves/); | 
          308 | 
                ->json_like('/error', qr/tooManyReserves/); | 
        
        
          | 304 | 
          };  | 
          309 | 
          };  | 
        
        
          | 305 | 
           | 
          310 | 
           | 
        
          
            
              | 306 | 
               | 
              311 | 
              $schema->storage->txn_rollback;  | 
            
            
              | 307 | 
              $dbh->rollback;  | 
               | 
               | 
            
        
          | 308 | 
           | 
          312 | 
           | 
        
        
          | 309 | 
          sub create_biblio { | 
          313 | 
          sub create_biblio { | 
        
        
          | 310 | 
              my ($title) = @_;  | 
          314 | 
              my ($title) = @_;  |