chat::test::new (private)

 chat::test::new [ -pretty_name pretty_name ] [ -user_id user_id ] \
    [ -user_info user_info ]

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

Create a new forum via the web interface.

Switches:
-pretty_name (optional, defaults to "Test Room")
-user_id (optional, defaults to "0")
-user_info (optional)

Partial Call Graph (max 5 caller/called nodes):
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::get_url_from_location acs::test::get_url_from_location (public) acs::test::http acs::test::http (public) chat::test::new chat::test::new chat::test::new->aa_get_first_url chat::test::new->acs::test::form_reply chat::test::new->acs::test::get_form chat::test::new->acs::test::get_url_from_location chat::test::new->acs::test::http

Testcases:
No testcase defined.
Source code:

        #
        # Get the chat package URL
        #
        set chat_page [aa_get_first_url -package_key chat]

        #
        # Get Data and check status code
        #
        if {$user_info eq ""} {
            set d [acs::test::http -user_id $user_id $chat_page/room-edit]
        } else {
            set d [acs::test::http -user_info $user_info $chat_page/room-edit]
        }
        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="edit-room"]}]

        #
        # Fill in a few values into the form
        #
        set d [::acs::test::form_reply  -last_request $d  -url [dict get $form_data @action]  -update [list  pretty_name $pretty_name  ]  [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

        #
        # Parse the final room_id from the return_url
        #
        set room_url [acs::test::get_url_from_location $d]
        regexp {[^&]?room_id=(\d+)[^&\d]?} $room_url _ room_id

        dict set d payload room_id $room_id

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