| 
      
            Lines 24-29
          use Test::Mojo;
      
      
        Link Here
      
     | 
  
        
          | 24 | 
          use t::lib::TestBuilder;  | 
          24 | 
          use t::lib::TestBuilder;  | 
        
        
          | 25 | 
          use t::lib::Mocks;  | 
          25 | 
          use t::lib::Mocks;  | 
        
        
          | 26 | 
           | 
          26 | 
           | 
        
            
               | 
               | 
              27 | 
              use Koha::ERM::Agreements;  | 
            
            
              | 28 | 
              use Koha::ERM::Documents;  | 
            
            
              | 29 | 
              use Koha::ERM::EHoldings::Packages;  | 
            
            
              | 30 | 
              use Koha::ERM::EHoldings::Titles;  | 
            
            
              | 31 | 
              use Koha::ERM::Licenses;  | 
            
            
              | 32 | 
              use Koha::ERM::EUsage::UsageDataProviders;  | 
            
            
              | 33 | 
               | 
            
        
          | 27 | 
          use Koha::Database;  | 
          34 | 
          use Koha::Database;  | 
        
        
          | 28 | 
           | 
          35 | 
           | 
        
        
          | 29 | 
          my $schema  = Koha::Database->new->schema;  | 
          36 | 
          my $schema  = Koha::Database->new->schema;  | 
        
  
    | 
      
            Lines 37-42
          subtest 'count() tests' => sub {
      
      
        Link Here
      
     | 
  
        
          | 37 | 
           | 
          44 | 
           | 
        
        
          | 38 | 
              $schema->storage->txn_begin;  | 
          45 | 
              $schema->storage->txn_begin;  | 
        
        
          | 39 | 
           | 
          46 | 
           | 
        
            
               | 
               | 
              47 | 
                  Koha::ERM::Agreements->search->delete;  | 
            
            
              | 48 | 
                  Koha::ERM::Documents->search->delete;  | 
            
            
              | 49 | 
                  Koha::ERM::EHoldings::Packages->search->delete;  | 
            
            
              | 50 | 
                  Koha::ERM::EHoldings::Titles->search->delete;  | 
            
            
              | 51 | 
                  Koha::ERM::Licenses->search->delete;  | 
            
            
              | 52 | 
                  Koha::ERM::EUsage::UsageDataProviders->search->delete;  | 
            
            
              | 53 | 
               | 
            
        
          | 40 | 
              my $librarian = $builder->build_object(  | 
          54 | 
              my $librarian = $builder->build_object(  | 
        
        
          | 41 | 
                  { | 
          55 | 
                  { | 
        
        
          | 42 | 
                      class => 'Koha::Patrons',  | 
          56 | 
                      class => 'Koha::Patrons',  | 
        
  
    | 
      
            Lines 64-71
          subtest 'count() tests' => sub {
      
      
        Link Here
      
     | 
  
        
          | 64 | 
              $t->get_ok("//$userid:$password@/api/v1/erm/counts")->status_is(200)->json_is( | 
          78 | 
              $t->get_ok("//$userid:$password@/api/v1/erm/counts")->status_is(200)->json_is( | 
        
        
          | 65 | 
                  { | 
          79 | 
                  { | 
        
        
          | 66 | 
                      counts => { | 
          80 | 
                      counts => { | 
        
          
            
              | 67 | 
                              agreements_count       => 1, documents_count => 0, eholdings_packages_count   => 0,  | 
              81 | 
                              agreements_count           => 1,  | 
            
            
              | 68 | 
                              eholdings_titles_count => 0, licenses_count  => 1, usage_data_providers_count => 0  | 
              82 | 
                              documents_count            => 0,  | 
            
            
               | 
               | 
              83 | 
                              eholdings_packages_count   => 0,  | 
            
            
              | 84 | 
                              eholdings_titles_count     => 0,  | 
            
            
              | 85 | 
                              licenses_count             => 1,  | 
            
            
              | 86 | 
                              usage_data_providers_count => 0  | 
            
        
          | 69 | 
                      }  | 
          87 | 
                      }  | 
        
        
          | 70 | 
                  }  | 
          88 | 
                  }  | 
        
        
          | 71 | 
              );  | 
          89 | 
              );  | 
        
            
              | 72 | 
              -   | 
               | 
               |