| Lines 16-22
          
      
      
        Link Here | 
        
          | 16 |  | 16 |  | 
        
          | 17 | use Modern::Perl; | 17 | use Modern::Perl; | 
        
          | 18 |  | 18 |  | 
          
            
              | 19 | use Test::More tests => 15; | 19 | use Test::More tests => 17; | 
        
          | 20 |  | 20 |  | 
        
          | 21 | use C4::Context; | 21 | use C4::Context; | 
        
          | 22 | use Koha::Database; | 22 | use Koha::Database; | 
  
    | Lines 75-80
          is( grep ( { $_->{branchcode} eq 'ANOTHERLIB' and $_->{selected} == 1 } @$librar
      
      
        Link Here | 
        
          | 75 | $libraries = $plugin->all( { selected => '' } ); | 75 | $libraries = $plugin->all( { selected => '' } ); | 
        
          | 76 | is( grep ( { exists $_->{selected} } @$libraries ), 0, 'With selected parameter set to an empty string, no library should be preselected' ); | 76 | is( grep ( { exists $_->{selected} } @$libraries ), 0, 'With selected parameter set to an empty string, no library should be preselected' ); | 
        
          | 77 |  | 77 |  | 
            
              |  |  | 78 | my $total = @{$plugin->all}; | 
            
              | 79 | my $pickupable = @{$plugin->all( { search_params => { pickup_location => 1 } }) }; | 
            
              | 80 | my $yet_another_library = $builder->build({ | 
            
              | 81 |     source => 'Branch', | 
            
              | 82 |     value => { | 
            
              | 83 |         branchcode => 'CANTPICKUP', | 
            
              | 84 |         pickup_location => 0, | 
            
              | 85 |     } | 
            
              | 86 | }); | 
            
              | 87 | is(@{$plugin->all( { search_params => { pickup_location => 1 } }) }, $pickupable, | 
            
              | 88 |    'Adding a new library with pickups' | 
            
              | 89 |    .' disabled does not increase the amount returned by ->pickup_locations'); | 
            
              | 90 | is(@{$plugin->all}, $total+1, 'However, adding a new library increases' | 
            
              | 91 |    .' the total amount gotten with ->all'); | 
            
              | 92 |  | 
        
          | 78 | t::lib::Mocks::mock_preference( 'IndependentBranches', 1 ); | 93 | t::lib::Mocks::mock_preference( 'IndependentBranches', 1 ); | 
        
          | 79 | $libraries = $plugin->all(); | 94 | $libraries = $plugin->all(); | 
        
          | 80 | is( scalar(@$libraries), 1, 'If IndependentBranches is set, only 1 library should be returned' ); | 95 | is( scalar(@$libraries), 1, 'If IndependentBranches is set, only 1 library should be returned' ); | 
            
              | 81 | -  |  |  |