| 
      
            Lines 16-22
          
      
      
        Link Here
      
     | 
  
        
          | 16 | 
           | 
          16 | 
           | 
        
        
          | 17 | 
          use Modern::Perl;  | 
          17 | 
          use Modern::Perl;  | 
        
        
          | 18 | 
           | 
          18 | 
           | 
        
          
            
              | 19 | 
              use Test::More tests => 14;  | 
              19 | 
              use Test::More tests => 15;  | 
            
        
          | 20 | 
           | 
          20 | 
           | 
        
        
          | 21 | 
          use C4::Context;  | 
          21 | 
          use C4::Context;  | 
        
        
          | 22 | 
          use Koha::Database;  | 
          22 | 
          use Koha::Database;  | 
        
  
    | 
      
            Lines 71-76
          is( grep ( { $_->{branchcode} eq 'ANOTHERLIB' and not exists $_->{selected} } @$
      
      
        Link Here
      
     | 
  
        
          | 71 | 
          $libraries = $plugin->all( { selected => 'ANOTHERLIB' } ); | 
          71 | 
          $libraries = $plugin->all( { selected => 'ANOTHERLIB' } ); | 
        
        
          | 72 | 
          is( grep ( { $_->{branchcode} eq 'MYLIBRARY'  and not exists $_->{selected} } @$libraries ), 1, 'With selected parameter, my library should not be preselected' ); | 
          72 | 
          is( grep ( { $_->{branchcode} eq 'MYLIBRARY'  and not exists $_->{selected} } @$libraries ), 1, 'With selected parameter, my library should not be preselected' ); | 
        
        
          | 73 | 
          is( grep ( { $_->{branchcode} eq 'ANOTHERLIB' and $_->{selected} == 1 } @$libraries ),       1, 'With selected parameter, other library should be preselected' ); | 
          73 | 
          is( grep ( { $_->{branchcode} eq 'ANOTHERLIB' and $_->{selected} == 1 } @$libraries ),       1, 'With selected parameter, other library should be preselected' ); | 
        
            
               | 
               | 
              74 | 
              $libraries = $plugin->all( { selected => '' } ); | 
            
            
              | 75 | 
              is( grep ( { exists $_->{selected} } @$libraries ), 0, 'With selected parameter set to an empty string, no library should be preselected' ); | 
            
        
          | 74 | 
           | 
          76 | 
           | 
        
        
          | 75 | 
          C4::Context->set_preference( 'IndependentBranches', 1 );  | 
          77 | 
          C4::Context->set_preference( 'IndependentBranches', 1 );  | 
        
        
          | 76 | 
          $libraries = $plugin->all();  | 
          78 | 
          $libraries = $plugin->all();  | 
        
            
              | 77 | 
              -   | 
               | 
               |