forums::test::new (private)

 forums::test::new [ -presentation_type presentation_type ] \
    [ -posting_policy posting_policy ] [ -user_id user_id ] \
    [ -user_info user_info ] name

Defined in packages/forums/tcl/test/webtest-procs.tcl

Create a new forum via the web interface.

Switches:
-presentation_type (optional, defaults to "flat")
-posting_policy (optional, defaults to "open")
-user_id (optional, defaults to "0")
-user_info (optional)
Parameters:
name (required)

Partial Call Graph (max 5 caller/called nodes):
%3 aa_get_first_url aa_get_first_url (public) acs::test::form_reply acs::test::form_reply (public) acs::test::get_form acs::test::get_form (public) acs::test::http acs::test::http (public) acs::test::reply_contains_no acs::test::reply_contains_no (public) forums::test::new forums::test::new forums::test::new->aa_get_first_url forums::test::new->acs::test::form_reply forums::test::new->acs::test::get_form forums::test::new->acs::test::http forums::test::new->acs::test::reply_contains_no

Testcases:
No testcase defined.
Source code:

        # Get the forums admin page url
        #
        set forums_page [aa_get_first_url -package_key forums]

        #
        # Get Data and check status code
        #
        if {$user_info eq ""} {
            set d [acs::test::http -user_id $user_id $forums_page/admin/forum-new]
        } else {
            set d [acs::test::http -user_info $user_info $forums_page/admin/forum-new]
        }
        acs::test::reply_has_status_code $d 200

        #
        # Get the form specific data (action, method and provided form-fields)
        #
        set form_data [::acs::test::get_form [dict get $d body] {//form[@id="forum"]}]

        #
        # Fill in a few values into the form
        #
        set d [::acs::test::form_reply  -last_request $d  -url [dict get $form_data @action]  -update [subst {
                       name             "$name"
                       charter          "bla [ad_generate_random_string] bla [ad_generate_random_string]"
                       charter.format    text/plain
                       presentation_type $presentation_type
                       posting_policy    $posting_policy
                   }]  [dict get $form_data fields]]
        set reply [dict get $d body]

        #
        # Check, if the form was correctly validated.
        #
        acs::test::reply_contains_no $d form-error
        acs::test::reply_has_status_code $d 302

        dict set d payload forum_id [dict get $form_data fields forum_id]

        return $d
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: