Changeset 2698
- Timestamp:
- 07/03/08 20:48:19 (20 months ago)
- Files:
-
- 1 modified
-
branches/release-41/t/mt_cms_blog.t (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/release-41/t/mt_cms_blog.t
r2211 r2698 10 10 11 11 12 plan tests => 17;12 plan tests => 25; 13 13 14 14 { … … 16 16 17 17 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'); 18 37 19 38 my $total_fileinfos = MT->model('fileinfo')->count({ blog_id => 1 }); 20 is($total_fileinfos, 24, 'blog #1 has 24fileinfos');39 is($total_fileinfos, 36, 'blog #1 has 36 fileinfos'); 21 40 22 41 my $static_fileinfos = MT->model('fileinfo')->count({ … … 24 43 virtual => [ \"= 0", \"is null" ], 25 44 }); 26 is($static_fileinfos, 24, "all blog #1's fileinfos are static");45 is($static_fileinfos, 36, "all blog #1's fileinfos are static"); 27 46 28 47 my $mapped_fileinfos = MT->model('fileinfo')->count({ … … 30 49 templatemap_id => \"is not null", 31 50 }); 32 is($mapped_fileinfos, 18, "blog #1 has 18fileinfos for archive pages (fileinfos with template maps)");51 is($mapped_fileinfos, 30, "blog #1 has 30 fileinfos for archive pages (fileinfos with template maps)"); 33 52 34 53 require MT::CMS::Blog; … … 92 111 blog_id => 1, 93 112 virtual => 1, 94 }), 18, '18 other fileinfos are virtual');113 }), 30, '18 other fileinfos are virtual'); 95 114 } 96 115
