| Lines 20-26
          
      
      
        Link Here | 
        
          | 20 | use Modern::Perl; | 20 | use Modern::Perl; | 
        
          | 21 |  | 21 |  | 
        
          | 22 | use Test::NoWarnings; | 22 | use Test::NoWarnings; | 
          
            
              | 23 | use Test::More tests => 24; | 23 | use Test::More tests => 25; | 
        
          | 24 |  | 24 |  | 
        
          | 25 | use Test::MockModule; | 25 | use Test::MockModule; | 
        
          | 26 | use Test::Exception; | 26 | use Test::Exception; | 
  
    | Lines 2579-2581
          subtest 'filter_by_in_bundle' => sub {
      
      
        Link Here | 
        
          | 2579 |     $schema->storage->txn_rollback; | 2579 |     $schema->storage->txn_rollback; | 
        
          | 2580 |  | 2580 |  | 
        
          | 2581 | }; | 2581 | }; | 
          
            
              | 2582 | -  | 2582 |  | 
            
              |  |  | 2583 | subtest 'filter_by_has_recalls' => sub { | 
            
              | 2584 |     plan tests => 2; | 
            
              | 2585 |  | 
            
              | 2586 |     $schema->storage->txn_begin; | 
            
              | 2587 |  | 
            
              | 2588 |     my $library = $builder->build_object( { class => 'Koha::Libraries' } ); | 
            
              | 2589 |  | 
            
              | 2590 |     $biblio = $builder->build_sample_biblio( { author => 'Hall, Daria' } ); | 
            
              | 2591 |     my $patron = $builder->build_object( { class => 'Koha::Patrons' } ); | 
            
              | 2592 |     t::lib::Mocks::mock_userenv( { branchcode => $patron->branchcode } ); | 
            
              | 2593 |  | 
            
              | 2594 |     my $item = $builder->build_sample_item( | 
            
              | 2595 |         { | 
            
              | 2596 |             biblionumber => $biblio->biblionumber, | 
            
              | 2597 |             library      => $library->branchcode, | 
            
              | 2598 |         } | 
            
              | 2599 |     ); | 
            
              | 2600 |  | 
            
              | 2601 |     C4::Circulation::AddIssue( $patron, $item->barcode ); | 
            
              | 2602 |  | 
            
              | 2603 |     is( $biblio->items->filter_by_has_recalls->count, 0, "0 items with recalls on this record" ); | 
            
              | 2604 |  | 
            
              | 2605 |     Koha::Recalls->add_recall( { biblio => $item->biblio, item => $item, patron => $patron } ); | 
            
              | 2606 |  | 
            
              | 2607 |     is( $biblio->items->filter_by_has_recalls->count, 1, "1 item with recalls on this record" ); | 
            
              | 2608 |  | 
            
              | 2609 |     $schema->storage->txn_rollback; | 
            
              | 2610 |  | 
            
              | 2611 | }; |