Changeset 2530

Show
Ignore:
Timestamp:
06/09/08 09:13:14 (20 months ago)
Author:
auno
Message:

Fixed to work test properly. BugzID:79876
* fixed some expected data
* clear cache data and not to set cache data
* fixed mtcomments lastn order

Location:
branches/release-39
Files:
5 modified

Legend:

Unmodified
Added
Removed
  • branches/release-39/lib/MT/Object.pm

    r2500 r2530  
    12381238    my $obj = shift; 
    12391239    my $oc = MT->request('object_cache') or return; 
     1240 
     1241    my $pk = $obj->primary_key; 
     1242    $pk = join ":", @$pk if ref $pk; 
     1243    my $key = ref($obj). ':' . $pk; 
     1244 
    12401245    if (@_) { 
    1241         $oc = $oc->{"$obj"}; 
     1246        $oc = $oc->{$key}; 
    12421247        delete $oc->{shift} if $oc; 
    12431248    } else { 
    1244         delete $oc->{"$obj"}; 
    1245     } 
     1249        delete $oc->{$key}; 
     1250    } 
     1251    1; 
    12461252} 
    12471253 
  • branches/release-39/lib/MT/Template/ContextHandlers.pm

    r2496 r2530  
    1003710037            if ($args->{lastn} || $args->{offset}) { 
    1003810038                $args{'direction'} =  'descend'; 
     10039                $so = 'descend'; 
    1003910040            } else { 
    1004010041                $args{'direction'} =  'ascend'; 
  • branches/release-39/lib/MT/Util.pm

    r2317 r2530  
    923923sub make_unique_basename { 
    924924    my ($entry) = @_; 
    925     my $blog = $entry->blog; 
     925    my $blog = MT::Blog->load($entry->blog_id); 
    926926    my $title = $entry->title; 
    927927    $title = '' if !defined $title; 
  • branches/release-39/t/35-tags.dat

    r2518 r2530  
    163163{ "r" : "1", "t" : "<MTComments lastn=\"1\"><MTCommentEntryID></MTComments>", "e" : "5"}, #112 
    164164{ "r" : "1", "t" : "<MTComments lastn=\"1\"><MTCommentIP></MTComments>", "e" : "127.0.0.1"}, #113 
    165 { "r" : "1", "t" : "<MTComments lastn=\"3\" glue=\",\"><MTCommentAuthorLink></MTComments>", "e" : "John Doe,Comment 3,<a title=\"http://chuckd.com/\" href=\"http://localhost/cgi-bin/mt-comments.cgi?__mode=red;id=14\">Chucky Dee</a>"}, #114 
     165{ "r" : "1", "t" : "<MTComments lastn=\"3\"><MTCommentAuthorLink>,</MTComments>", "e" : "John Doe,Comment 3,<a title=\"http://chuckd.com/\" href=\"http://chuckd.com/\">Chucky Dee</a>,"}, #114 
    166166{ "r" : "1", "t" : "<MTComments lastn=\"1\"><MTCommentEmail></MTComments>", "e" : "johnd@doe.com"}, #115 
    167 { "r" : "1", "t" : "<MTComments lastn=\"1\"><MTCommentAuthorIdentity></MTComments>", "e" : "<img alt=\"Author Profile Page\" src=\"/cgi-bin/mt-static/images/comment/typekey_logo.png\" width=\"16\" height=\"16\" />"}, #116 
     167{ "r" : "1", "t" : "<MTComments lastn=\"1\"><MTCommentAuthorIdentity></MTComments>", "e" : "<img alt=\"Author Profile Page\" src=\"http://localhost/mt-static/images/comment/typekey_logo.png\" width=\"16\" height=\"16\" />"}, #116 
    168168{ "r" : "1", "t" : "<MTComments lastn=\"1\"><MTCommentURL></MTComments>", "e" : "http://john.doe.com/"}, #117 
    169169{ "r" : "1", "t" : "<MTComments lastn=\"1\"><MTCommentOrderNumber></MTComments>", "e" : "1"}, #118 
     
    253253{ "r" : "1", "t" : "<MTEntries lastn=\"1\" offset=\"3\"><MTIfCategory name=\"foo\">in category</MTIfCategory></MTEntries>", "e" : "in category"}, #201 
    254254{ "r" : "1", "t" : "", "e" : ""}, #202 
    255 { "r" : "1", "t" : "<MTIndexList><MTIndexName>-<MTIndexLink>-<MTIndexBasename>;</MTIndexList>", "e" : "Archive Index-http://narnia.na/nana/archives.html-index;Atom-http://narnia.na/nana/atom.xml-index;JavaScript-http://narnia.na/nana/mt.js-index;Main Index-http://narnia.na/nana/-index;RSD-http://narnia.na/nana/rsd.xml-index;RSS-http://narnia.na/nana/rss.xml-index;Stylesheet-http://narnia.na/nana/styles.css-index;"}, #203 
     255{ "r" : "1", "t" : "<MTIndexList><MTIndexName>-<MTIndexLink>-<MTIndexBasename>;</MTIndexList>", "e" : "Archive Index-http://narnia.na/nana/archives.html-index;Feed - Recent Entries-http://narnia.na/nana/atom.xml-index;JavaScript-http://narnia.na/nana/mt.js-index;Main Index-http://narnia.na/nana/-index;RSD-http://narnia.na/nana/rsd.xml-index;Stylesheet-http://narnia.na/nana/styles.css-index;"}, #203 
    256256{ "r" : "1", "t" : "<MTIfNeedEmail>email needed</MTIfNeedEmail>", "e" : ""}, #204 
    257257{ "r" : "1", "t" : "<MTIfAllowCommentHTML>comment html allowed</MTIfAllowCommentHTML>", "e" : "comment html allowed"}, #205 
     
    273273{ "r" : "1", "t" : "<MTArchiveList archive_type='Daily'><MTArchiveDateEnd></MTArchiveList>", "e" : "January 31, 1978 11:59 PMJanuary 31, 1965 11:59 PMJanuary 31, 1964 11:59 PMJanuary 31, 1963 11:59 PMJanuary 31, 1962 11:59 PMJanuary 31, 1961 11:59 PM"}, #221 
    274274{ "r" : "1", "t" : "<MTArchiveList archive_type='Weekly'><MTArchiveDateEnd></MTArchiveList>", "e" : "February  4, 1978 11:59 PMFebruary  6, 1965 11:59 PMFebruary  1, 1964 11:59 PMFebruary  2, 1963 11:59 PMFebruary  3, 1962 11:59 PMFebruary  4, 1961 11:59 PM"}, #222 
    275 { "r" : "1", "t" : "<MTComments lastn='3'><MTFeedbackScore>,</MTComments>", "e" : "0,0,1.5,"}, #223 
    276 { "r" : "1", "t" : "<MTComments lastn='3'>,<MTIfNonEmpty tag='CommenterName'><MTCommenterName>: <MTCommenterIfTrusted>trusted<MTElse>untrusted</MTElse></MTCommenterIfTrusted><MTElse><MTCommentAuthor></MTIfNonEmpty></MTComments>", "e" : ",Chucky Dee: trusted,Comment 3,John Doe: trusted"}, #224 
     275{ "r" : "1", "t" : "<MTComments lastn='3'><MTFeedbackScore>,</MTComments>", "e" : "1.5,0,0,"}, #223 
     276{ "r" : "1", "t" : "<MTComments lastn='3'>,<MTIfNonEmpty tag='CommenterName'><MTCommenterName>: <MTCommenterIfTrusted>trusted<MTElse>untrusted</MTElse></MTCommenterIfTrusted><MTElse><MTCommentAuthor></MTIfNonEmpty></MTComments>", "e" : ",John Doe: trusted,Comment 3,Chucky Dee: trusted"}, #224 
    277277{ "r" : "1", "t" : "<MTTags glue=','><MTTagName> <MTTagRank></MTTags>", "e" : "anemones 4,grandpa 6,rain 2,strolling 6,verse 1"}, #225 
    278278{ "r" : "1", "t" : "<MTEntries tag='grandpa' lastn='1'><MTEntryTags glue=','><MTTagRank></MTEntryTags></MTEntries>", "e" : "6,2,6"}, #226 
     
    406406{ "r" : "1", "t" : "<MTAuthors sort_by='display_name' sort_order='descend'><MTAuthorID>;</MTAuthors>", "e" : "3;2;"}, #354 
    407407{ "r" : "1", "t" : "<MTArchives><MTArchiveLabel></MTArchives>", "e" : "EntryMonthlyWeeklyDailyCategoryPage"}, #355 
    408 { "r" : "1", "t" : "<MTEntries><$MTEntryID$>:<MTComments><MTIfCommenterIsAuthor><MTIfCommenterIsEntryAuthor>2<MTElse>1</MTIfCommenterIsEntryAuthor><MTElse>0</MTIfCommenterIsAuthor>;</MTComments></MTEntries>", "e" : "1:0;0;0;8:0;7:6:2;1;0;5:0;4:"}, #356 
     408{ "r" : "1", "t" : "<MTEntries><$MTEntryID$>:<MTComments><MTIfCommenterIsAuthor><MTIfCommenterIsEntryAuthor>2<MTElse>1</MTIfCommenterIsEntryAuthor><MTElse>0</MTIfCommenterIsAuthor>;</MTComments></MTEntries>", "e" : "1:0;0;0;8:0;7:6:1;2;0;5:0;4:"}, #356 
    409409{ "r" : "1", "t" : "<MTPages id='20'><$MTPageMore$></MTPages>", "e" : "<p>I don't have much to say,</p>"}, #357 
    410410{ "r" : "1", "t" : "<MTAssets lastn='1'><$MTAssetlabel$></MTAssets>", "e" : "Image photo"}, #358 
     
    412412{ "r" : "1", "t" : "<MTPages id='20'><MTPageAssets><$MTAssetID$></MTPageAssets></MTPages>", "e" : "2"}, #360 
    413413{ "r" : "1", "t" : "<MTAuthors><$MTAuthorAuthType$>:<$MTAuthorAuthIconURL$>;</MTAuthors>", "e" : "MT:http://localhost/mt-static/images/comment/mt_logo.png;MT:http://localhost/mt-static/images/comment/mt_logo.png;"}, #361 
    414 { "r" : "1", "t" : "<MTComments><$MTCommenterAuthType$>:<$MTCommenterAuthIconURL$>;</MTComments>", "e" : ":;:;:;:;MT:http://localhost/mt-static/images/comment/mt_logo.png;MT:http://localhost/mt-static/images/comment/mt_logo.png;:;TypeKey:http://localhost/mt-static/images/comment/typekey_logo.png;:;"}, #362 
     414{ "r" : "1", "t" : "<MTComments><$MTCommenterAuthType$>:<$MTCommenterAuthIconURL$>;</MTComments>", "e" : ":;:;:;:;:;MT:http://localhost/mt-static/images/comment/mt_logo.png;MT:http://localhost/mt-static/images/comment/mt_logo.png;:;TypeKey:http://localhost/mt-static/images/comment/typekey_logo.png;"}, #362 
    415415{ "r" : "1", "t" : "<MTAuthors sort_by='id' need_entry='0' ><MTAuthorName>;</MTAuthors>", "e" : "Melody;Chuck D;Bob D;"}, #363 
    416416{ "r" : "1", "t" : "<MTAuthors sort_by='id' need_entry='0' status='disabled'><MTAuthorName>;</MTAuthors>", "e" : "Hiro Nakamura;"}, #364 
  • branches/release-39/t/lib/MT/Test.pm

    r2451 r2530  
    200200    $blog->commenter_authenticators('enabled_TypeKey'); 
    201201    $blog->save() or die "Couldn't save blog 1: ". $blog->errstr; 
     202    MT::ObjectDriver::Driver::Cache::RAM->clear_cache(); 
    202203    diag "Saved blog"; 
    203204 
     
    316317        diag "Saved entry #1"; 
    317318    } 
     319    $entry->clear_cache(); 
    318320 
    319321    $entry = MT::Entry->load(2); 
     
    337339        diag "Saved entry #2"; 
    338340    } 
     341    $entry->clear_cache(); 
    339342 
    340343    $entry = MT::Entry->load(3); 
     
    360363        diag "Saved entry #3"; 
    361364    } 
     365    $entry->clear_cache(); 
    362366 
    363367    require MT::Trackback;