| 
      
            Lines 43-58
          subtest 'CRUD' => sub {
      
      
        Link Here
      
     | 
  
        
          | 43 | 
              is( $shelf->allow_change_from_others, 0, 'The default value for allow_change_from_others should be 0' );  | 
          43 | 
              is( $shelf->allow_change_from_others, 0, 'The default value for allow_change_from_others should be 0' );  | 
        
        
          | 44 | 
              is( output_pref($shelf->created_on), output_pref(dt_from_string), 'The creation time should have been set to today' );  | 
          44 | 
              is( output_pref($shelf->created_on), output_pref(dt_from_string), 'The creation time should have been set to today' );  | 
        
        
          | 45 | 
           | 
          45 | 
           | 
        
          
            
              | 46 | 
                  my $shelf_18672 = Koha::Virtualshelves->find( $shelf->shelfnumber ); # Bug 18672  | 
              46 | 
                  # Test if creation date will not be overwritten by store  | 
            
            
              | 47 | 
                  my $created_18672 = $shelf_18672->created_on;  | 
              47 | 
                  my $created = dt_from_string->subtract( hours => 1 );  | 
            
            
              | 48 | 
                  sleep 2; # Wait 2 seconds, then store  | 
              48 | 
                  $shelf->created_on( $created );  | 
            
        
          | 49 | 
              $shelf->store;  | 
          49 | 
              $shelf->store;  | 
        
            
              | 50 | 
                  $shelf_18672 = Koha::Virtualshelves->find( $shelf->shelfnumber );  | 
               | 
               | 
            
            
              | 51 | 
                  is($shelf_18672->created_on, $created_18672, 'Creation date is the same after update (Bug 18672)' );  | 
            
        
          | 52 | 
           | 
          50 | 
           | 
        
        
          | 53 | 
              my $retrieved_shelf = Koha::Virtualshelves->find( $shelf->shelfnumber );  | 
          51 | 
              my $retrieved_shelf = Koha::Virtualshelves->find( $shelf->shelfnumber );  | 
        
        
          | 54 | 
           | 
          52 | 
           | 
        
        
          | 55 | 
              is( $retrieved_shelf->shelfname, $shelf->shelfname, 'Find should correctly return the shelfname' );  | 
          53 | 
              is( $retrieved_shelf->shelfname, $shelf->shelfname, 'Find should correctly return the shelfname' );  | 
        
            
               | 
               | 
              54 | 
                  is( dt_from_string($retrieved_shelf->created_on), $created, 'Creation date is the same after update (Bug 18672)' );  | 
            
        
          | 56 | 
           | 
          55 | 
           | 
        
        
          | 57 | 
              # Insert with the same name  | 
          56 | 
              # Insert with the same name  | 
        
        
          | 58 | 
              eval { | 
          57 | 
              eval { | 
        
            
              | 59 | 
              -   | 
               | 
               |