Index: openacs-4/packages/acs-content-repository/tcl/test/content-item-test-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/tcl/test/content-item-test-procs.tcl,v diff -u -r1.13.2.4 -r1.13.2.5 --- openacs-4/packages/acs-content-repository/tcl/test/content-item-test-procs.tcl 6 Mar 2021 16:59:02 -0000 1.13.2.4 +++ openacs-4/packages/acs-content-repository/tcl/test/content-item-test-procs.tcl 6 Mar 2021 19:17:25 -0000 1.13.2.5 @@ -12,25 +12,27 @@ -procs { ad_generate_random_string content::folder::delete + content::folder::get_index_page + content::folder::get_label content::folder::is_empty content::folder::is_folder + content::folder::is_registered content::folder::is_root content::folder::new - content::folder::get_index_page - content::folder::get_label - content::folder::is_registered content::folder::register_content_type content::item::delete content::item::get + content::item::get_content_type content::item::get_id content::item::get_latest_revision content::item::new content::item::rename content::item::update + content::revision::is_latest + content::revision::is_live content::type::attribute::new content::type::delete content::type::new - content::item::get_content_type package_object_attribute_list } \ @@ -119,11 +121,21 @@ set content_type [content::item::get_content_type -item_id $first_item_id] aa_true "content_type is '$content_type'" {$content_type eq "content_revision"} - + aa_false "First item is not a folder" [content::folder::is_folder -item_id $first_item_id] aa_true "first item exists" {[content::item::get -item_id $first_item_id] == 1} + content::item::get -item_id $first_item_id -array item_info + set revision_id [dict get [array get item_info] revision_id] + + aa_equals "content_revision is latest" \ + [content::revision::is_latest -revision_id $revision_id] \ + t + aa_equals "content_revision is live" \ + [content::revision::is_live -revision_id $revision_id] \ + t + aa_true "First item's revision exists" \ {[db_string get_revision { select latest_revision from cr_items, cr_revisions @@ -252,7 +264,7 @@ set content_type [content::item::get_content_type -item_id $new_type_item_id] aa_true "content_type is '$content_type" {$content_type eq "test_type"} - + ######################################################### # test update of item and attributes ######################################################### Index: openacs-4/packages/acs-content-repository/tcl/test/content-revision-test-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/tcl/test/content-revision-test-procs.tcl,v diff -u -r1.9.2.2 -r1.9.2.3 --- openacs-4/packages/acs-content-repository/tcl/test/content-revision-test-procs.tcl 6 Mar 2021 17:09:32 -0000 1.9.2.2 +++ openacs-4/packages/acs-content-repository/tcl/test/content-revision-test-procs.tcl 6 Mar 2021 19:17:25 -0000 1.9.2.3 @@ -16,11 +16,15 @@ content::folder::unregister_content_type content::item::delete content::item::get_content + content::item::get_revision_count content::item::new - content::revision::new content::revision::get_title + content::revision::is_latest + content::revision::is_live content::revision::item_id - cr_write_content + content::revision::new + content::revision::revision_name + cr_write_content } \ content_revision { content revision test @@ -75,12 +79,41 @@ aa_equals "content_revision is consistent" \ [content::revision::item_id -revision_id $revision_id] \ $first_item_id - + + aa_equals "content_revision is latest" \ + [content::revision::is_latest -revision_id $revision_id] \ + t + aa_equals "content_revision is live" \ + [content::revision::is_live -revision_id $revision_id] \ + f + + aa_equals "content_revision name" \ + [content::revision::revision_name -revision_id $revision_id] \ + "Revision 1 of 1 for item: Test Title" + + aa_equals "content_revision count for first item" \ + [content::item::get_revision_count -item_id $first_item_id] \ + 1 + aa_equals "Title of the revision should be $title" \ - "$title" \ - [content::revision::get_title \ - -revision_id $returned_revision_id] + $title \ + [content::revision::get_title \ + -revision_id $returned_revision_id] + set revision_id2 [content::revision::new \ + -item_id $first_item_id \ + -title "rev2" \ + -description "Test Description2" \ + -content "Test Content2"] + + aa_equals "content_revision count for first item" \ + [content::item::get_revision_count -item_id $first_item_id] \ + 2 + + aa_equals "content_revision name" \ + [content::revision::revision_name -revision_id $revision_id2] \ + "Revision 2 of 2 for item: rev2" + content::item::delete -item_id $first_item_id content::folder::unregister_content_type \