| 
      
            Lines 19-25
          
      
      
        Link Here
      
     | 
  
        
          | 19 | 
           | 
          19 | 
           | 
        
        
          | 20 | 
          use Modern::Perl;  | 
          20 | 
          use Modern::Perl;  | 
        
        
          | 21 | 
           | 
          21 | 
           | 
        
          
            
              | 22 | 
              use Test::More tests => 11;  | 
              22 | 
              use Test::More tests => 12;  | 
            
        
          | 23 | 
           | 
          23 | 
           | 
        
        
          | 24 | 
          use C4::Biblio;  | 
          24 | 
          use C4::Biblio;  | 
        
        
          | 25 | 
          use C4::Context;  | 
          25 | 
          use C4::Context;  | 
        
  
    | 
      
            Lines 119-124
          subtest '->get_effective_marcorgcode' => sub {
      
      
        Link Here
      
     | 
  
        
          | 119 | 
              $schema->storage->txn_rollback;  | 
          119 | 
              $schema->storage->txn_rollback;  | 
        
        
          | 120 | 
          };  | 
          120 | 
          };  | 
        
        
          | 121 | 
           | 
          121 | 
           | 
        
            
               | 
               | 
              122 | 
              subtest '->from_email_address' => sub { | 
            
            
              | 123 | 
               | 
            
            
              | 124 | 
                  plan tests => 3;  | 
            
            
              | 125 | 
               | 
            
            
              | 126 | 
                  $schema->storage->txn_begin;  | 
            
            
              | 127 | 
               | 
            
            
              | 128 | 
                  my $library_1 = $builder->build_object(  | 
            
            
              | 129 | 
                      { | 
            
            
              | 130 | 
                          class => 'Koha::Libraries',  | 
            
            
              | 131 | 
                          value => { | 
            
            
              | 132 | 
                              branchemail   => 'from@mybranc.com',  | 
            
            
              | 133 | 
                          }  | 
            
            
              | 134 | 
                      }  | 
            
            
              | 135 | 
                  );  | 
            
            
              | 136 | 
               | 
            
            
              | 137 | 
                  t::lib::Mocks::mock_preference( 'KohaAdminEmailAddress', 'admin@mylibrary.com' );  | 
            
            
              | 138 | 
               | 
            
            
              | 139 | 
                  is( $library_1->from_email_address, $library_1->branchemail,  | 
            
            
              | 140 | 
                     'If defined, use branches branchemail address');  | 
            
            
              | 141 | 
               | 
            
            
              | 142 | 
                  $library_1->branchemail(undef)->store();  | 
            
            
              | 143 | 
                  is( $library_1->from_email_address, 'admin@mylibrary.com',  | 
            
            
              | 144 | 
                     'Fallback to KohaAdminEmailAddress email address when branchemail is undefined');  | 
            
            
              | 145 | 
               | 
            
            
              | 146 | 
                  t::lib::Mocks::mock_preference( 'KohaAdminEmailAddress', '' );  | 
            
            
              | 147 | 
                  is( $library_1->from_email_address, undef,  | 
            
            
              | 148 | 
                     'Return undef when branchemail and KohaAdminEmailAddress are both undefined');  | 
            
            
              | 149 | 
                  $schema->storage->txn_rollback;  | 
            
            
              | 150 | 
              };  | 
            
            
              | 151 | 
               | 
            
        
          | 122 | 
          subtest '->inbound_email_address' => sub { | 
          152 | 
          subtest '->inbound_email_address' => sub { | 
        
        
          | 123 | 
           | 
          153 | 
           | 
        
        
          | 124 | 
              plan tests => 5;  | 
          154 | 
              plan tests => 5;  | 
        
            
              | 125 | 
              -   | 
               | 
               |