| Lines 23-28
          use JSON qw( to_json );
      
      
        Link Here | 
        
          | 23 | use Test::More tests => 4; | 23 | use Test::More tests => 4; | 
        
          | 24 |  | 24 |  | 
        
          | 25 | use t::lib::TestBuilder; | 25 | use t::lib::TestBuilder; | 
            
              |  |  | 26 | use t::lib::Mocks; | 
        
          | 26 | use Test::Exception; | 27 | use Test::Exception; | 
        
          | 27 |  | 28 |  | 
        
          | 28 | use Koha::Database; | 29 | use Koha::Database; | 
  
    | Lines 408-414
          subtest 'merge_and_replace_with' => sub {
      
      
        Link Here | 
        
          | 408 | }; | 409 | }; | 
        
          | 409 |  | 410 |  | 
        
          | 410 | subtest 'action log tests' => sub { | 411 | subtest 'action log tests' => sub { | 
          
            
              | 411 |     plan tests => 3; | 412 |     plan tests => 4; | 
        
          | 412 |     my $schema = Koha::Database->new->schema; | 413 |     my $schema = Koha::Database->new->schema; | 
        
          | 413 |     $schema->storage->txn_begin; | 414 |     $schema->storage->txn_begin; | 
        
          | 414 |  | 415 |  | 
  
    | Lines 420-425
          subtest 'action log tests' => sub {
      
      
        Link Here | 
        
          | 420 |         } | 421 |         } | 
        
          | 421 |     ); | 422 |     ); | 
        
          | 422 |  | 423 |  | 
            
              |  |  | 424 |     t::lib::Mocks::mock_preference( 'BorrowersLog', 0 ); | 
        
          | 423 |     my $attributes = [ | 425 |     my $attributes = [ | 
        
          | 424 |         { | 426 |         { | 
        
          | 425 |             attribute => 'Foo', | 427 |             attribute => 'Foo', | 
  
    | Lines 440-445
          subtest 'action log tests' => sub {
      
      
        Link Here | 
        
          | 440 |             info => $info | 442 |             info => $info | 
        
          | 441 |         } | 443 |         } | 
        
          | 442 |     ); | 444 |     ); | 
            
              |  |  | 445 |     is( | 
            
              | 446 |         $action_logs->count, | 
            
              | 447 |         0, | 
            
              | 448 |         'No action log entry has been created when adding patron attribute if BorrowersLog syspref disabled' | 
            
              | 449 |     ); | 
            
              | 450 |     $patron->extended_attributes([]); | 
            
              | 451 |  | 
            
              | 452 |     t::lib::Mocks::mock_preference( 'BorrowersLog', 1 ); | 
            
              | 453 |     $patron->extended_attributes($attributes); | 
            
              | 454 |     $action_logs = Koha::ActionLogs->search( | 
            
              | 455 |         { | 
            
              | 456 |             module => "MEMBERS", | 
            
              | 457 |             action => "MODIFY", | 
            
              | 458 |             object => $patron->borrowernumber, | 
            
              | 459 |             info => $info | 
            
              | 460 |         } | 
            
              | 461 |     ); | 
        
          | 443 |     is( | 462 |     is( | 
        
          | 444 |         $action_logs->count, | 463 |         $action_logs->count, | 
        
          | 445 |         1, | 464 |         1, | 
            
              | 446 | -  |  |  |