Changeset 2698

Show
Ignore:
Timestamp:
07/03/08 20:48:19 (12 months ago)
Author:
mpaschal
Message:

Update counts to match new template maps in test data blog
BugzID: 80147

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/release-41/t/mt_cms_blog.t

    r2211 r2698  
    1010 
    1111 
    12 plan tests => 17; 
     12plan tests => 25; 
    1313 
    1414{ 
     
    1616 
    1717    ok(MT->model('blog')->load(1), 'have a blog #1'); 
     18    # This test blog has: 
     19    #   6 index templates 
     20    #   6 published entries across 6 different years 
     21    #   4 pages 
     22    #   2 placements (entry-category mappings) 
     23    #   individual, monthly, weekly, daily, category and page archives 
     24 
     25    sub finfos_of_type { 
     26        return MT->model('fileinfo')->count({ blog_id => 1, archive_type => shift }); 
     27    } 
     28 
     29    is(finfos_of_type('index'),      6, 'blog #1 has 6 index template fileinfos'); 
     30    is(finfos_of_type('Individual'), 6, 'blog #1 has 6 individual fileinfos'); 
     31    is(finfos_of_type('Daily'),      6, 'blog #1 has 6 daily fileinfos'); 
     32    is(finfos_of_type('Monthly'),    6, 'blog #1 has 6 monthly fileinfos'); 
     33    is(finfos_of_type('Weekly'),     6, 'blog #1 has 6 weekly fileinfos'); 
     34    is(finfos_of_type('Yearly'),     0, 'blog #1 has 0 yearly fileinfos'); 
     35    is(finfos_of_type('Page'),       4, 'blog #1 has 4 page fileinfos'); 
     36    is(finfos_of_type('Category'),   2, 'blog #1 has 2 category fileinfos'); 
    1837 
    1938    my $total_fileinfos = MT->model('fileinfo')->count({ blog_id => 1 }); 
    20     is($total_fileinfos, 24, 'blog #1 has 24 fileinfos'); 
     39    is($total_fileinfos, 36, 'blog #1 has 36 fileinfos'); 
    2140 
    2241    my $static_fileinfos = MT->model('fileinfo')->count({ 
     
    2443        virtual => [ \"= 0", \"is null" ], 
    2544    }); 
    26     is($static_fileinfos, 24, "all blog #1's fileinfos are static"); 
     45    is($static_fileinfos, 36, "all blog #1's fileinfos are static"); 
    2746 
    2847    my $mapped_fileinfos = MT->model('fileinfo')->count({ 
     
    3049        templatemap_id => \"is not null", 
    3150    }); 
    32     is($mapped_fileinfos, 18, "blog #1 has 18 fileinfos for archive pages (fileinfos with template maps)"); 
     51    is($mapped_fileinfos, 30, "blog #1 has 30 fileinfos for archive pages (fileinfos with template maps)"); 
    3352 
    3453    require MT::CMS::Blog; 
     
    92111        blog_id => 1, 
    93112        virtual => 1, 
    94     }), 18, '18 other fileinfos are virtual'); 
     113    }), 30, '18 other fileinfos are virtual'); 
    95114} 
    96115