Changeset 2730

Show
Ignore:
Timestamp:
07/08/08 07:58:50 (2 months ago)
Author:
fumiakiy
Message:

Unit test update - more strict checking of columns of MT::Trackback, MT::Folder and MT::Category.

Changed the order of the backup so the triggers won't affect the restored objects.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/release-41/lib/MT/BackupRestore.pm

    r2693 r2730  
    6767        'ping_cat'      => { 
    6868            'order' => 520 
     69        }, 
     70        # Comment should be backed up after TBPing 
     71        # because saving a comment ultimately triggers 
     72        # MT::TBPing::save. 
     73        'comment'        => { 
     74            'order' => 530 
    6975        }, 
    7076        # Session, config and TheSchwartz packages are never backed up. 
  • branches/release-41/t/61-to_from_xml.t

    r2695 r2730  
    157157                    isnt(undef, $parent, "parent object(" . $old->id . ") of $class pointed to by $col should not be undef"); 
    158158                } else { 
    159                     next if $col eq 'modified_on'; 
    160159                    next if ( 
    161160                        (defined($old->column($col)) && ($old->column($col) eq '')) && 
    162161                        (!defined($obj->column($col))) 
    163162                    ); 
    164                     next if ($name eq 'category' && ($col eq 'parent')); 
    165                     next if ($name eq 'folder' && ($col eq 'parent')); 
     163                    if ($name eq 'category' && ($col eq 'parent') && $old->parent) { 
     164                        my $parent = $objects->{'MT::Category#' . $old->parent}; 
     165                        is( $obj->$col, $parent->id, 'Category parent restored'); 
     166                        next; 
     167                    } 
     168                    if ($name eq 'folder' && ($col eq 'parent') && $old->parent) { 
     169                        my $parent = $objects->{'MT::Folder#' . $old->parent}; 
     170                        is( $obj->$col, $parent->id, 'Folder parent restored'); 
     171                        next; 
     172                    } 
    166173                    if ( ($name eq 'trackback') && ($col eq 'is_disabled') ) { 
    167174                        if ( defined($obj->is_disabled) && $obj->is_disabled