Changeset 2886

Show
Ignore:
Timestamp:
08/01/08 23:28:22 (4 months ago)
Author:
mpaschal
Message:

Compare column definition data types after conversion to db type, like MT::Upgrade actually does
BugzID: 80847

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/release-42/t/ddl-tests.pl

    r2884 r2886  
    227227    } 
    228228 
    229     if (!defined $got->{type} || $expected->{type} ne $got->{type}) { 
     229    if (!defined $got->{type}) { 
    230230        fail($reason); 
    231         diag("Expected type ", $expected->{type}, " but got ", $got->{type}); 
     231        diag("Expected MT data type ", $expected->{type}, " but got no type at all"); 
     232        return; 
     233    } 
     234 
     235    my $ddl_class     = MT::Object->driver->dbd->ddl_class; 
     236    my $got_type      = $ddl_class->type2db($got); 
     237    my $expected_type = $ddl_class->type2db($expected); 
     238    if (!defined $got_type || $expected_type ne $got_type) { 
     239        fail($reason); 
     240        diag("Expected db data type ", $expected_type, " but got ", $got_type); 
    232241        return; 
    233242    }