Index: openacs-4/packages/acs-authentication/tcl/test/acs-authentication-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-authentication/tcl/test/acs-authentication-procs.tcl,v diff -u -N -r1.42 -r1.43 --- openacs-4/packages/acs-authentication/tcl/test/acs-authentication-procs.tcl 10 Feb 2009 18:27:08 -0000 1.42 +++ openacs-4/packages/acs-authentication/tcl/test/acs-authentication-procs.tcl 27 Oct 2014 16:39:02 -0000 1.43 @@ -167,7 +167,8 @@ } } - aa_false "No creation_message for successful creation" [exists_and_not_null user_info(creation_message)] + aa_false "No creation_message for successful creation" \ + [expr {[info exists user_info(creation_message)] && $user_info(creation_message) ne ""}] aa_true "returns user_id" [info exists user_info(user_id)] if { [info exists user_info(user_id)] } { @@ -187,12 +188,14 @@ aa_equals "creation_status for duplicate email and username" $user_info(creation_status) "data_error" - aa_true "element_messages exists" [exists_and_not_null user_info(element_messages)] - if { [exists_and_not_null user_info(element_messages)] } { + aa_true "element_messages exists" [info exists user_info(element_messages)] + if { [info exists user_info(element_messages)] && $user_info(element_messages) ne "" } { array unset elm_msgs array set elm_msgs $user_info(element_messages) - aa_true "element_message for username exists" [exists_and_not_null elm_msgs(username)] - aa_true "element_message for email exists" [exists_and_not_null elm_msgs(email)] + aa_true "element_message for username exists" \ + [expr {[info exists elm_msgs(username)] && $elm_msgs(username) ne ""}] + aa_true "element_message for email exists" \ + [expr {[info exists elm_msgs(email)] && $elm_msgs(email) ne ""}] } set user_id [acs_user::get_by_username -username auth_create_user1] if { $user_id ne "" } { @@ -212,18 +215,19 @@ aa_equals "creation_status is data_error" $user_info(creation_status) "data_error" - aa_true "element_messages exists" [exists_and_not_null user_info(element_messages)] - if { [exists_and_not_null user_info(element_messages)] } { + aa_true "element_messages exists" [info exists user_info(element_messages)] + if { [info exists user_info(element_messages)] && $user_info(element_messages) ne "" } { array unset elm_msgs array set elm_msgs $user_info(element_messages) - if { [aa_true "element_message(email) exists" [exists_and_not_null elm_msgs(email)]] } { + if { [aa_true "element_message(email) exists" \ + [expr {[info exists elm_msgs(email)] && $elm_msgs(email) ne ""}] aa_log "element_message(email) = $elm_msgs(email)" } - if { [aa_true "element_message(first_names) exists" [exists_and_not_null elm_msgs(first_names)]] } { + if { [aa_true "element_message(first_names) exists" [info exists elm_msgs(first_names)] aa_log "element_message(first_names) = $elm_msgs(first_names)" } - if { [aa_true "element_message(last_name) exists" [exists_and_not_null elm_msgs(last_name)]] } { + if { [aa_true "element_message(last_name) exists" [info exists elm_msgs(last_name)] aa_log "element_message(last_name) = $elm_msgs(last_name)" } } @@ -245,18 +249,18 @@ aa_equals "creation_status is data_error" $user_info(creation_status) "data_error" - aa_true "element_messages exists" [exists_and_not_null user_info(element_messages)] - if { [exists_and_not_null user_info(element_messages)] } { + aa_true "element_messages exists" [info exists user_info(element_messages)] + if { [info exists user_info(element_messages)] && $user_info(element_messages) ne "" } { array unset elm_msgs array set elm_msgs $user_info(element_messages) - if { [aa_true "element_message(email) exists" [exists_and_not_null elm_msgs(email)]] } { + if { [aa_true "element_message(email) exists" [info exists elm_msgs(email)]] } { aa_log "element_message(email) = $elm_msgs(email)" } - if { [aa_true "element_message(first_names) exists" [exists_and_not_null elm_msgs(first_names)]] } { + if { [aa_true "element_message(first_names) exists" [info exists elm_msgs(first_names)]] } { aa_log "element_message(first_names) = $elm_msgs(first_names)" } - if { [aa_true "element_message(last_name) exists" [exists_and_not_null elm_msgs(last_name)]] } { + if { [aa_true "element_message(last_name) exists" [info exists elm_msgs(last_name)]] } { aa_log "element_message(last_name) = $elm_msgs(last_name)" } } @@ -655,7 +659,7 @@ } array unset retrieved_value $parameter } - aa_true "Only the right parameters were retrieved" [expr [llength [array names retrieved_value]] == 0] + aa_true "Only the right parameters were retrieved" [expr {[array size retrieved_value] == 0}] } } @@ -677,7 +681,7 @@ aa_false "Param UseEmailForLoginP 0 -> false" [auth::UseEmailForLoginP] array set elms [auth::get_registration_elements] - aa_false "Registration elements do contain username" [expr [lsearch [concat $elms(required) $elms(optional)] "username"] == -1] + aa_false "Registration elements do contain username" [expr {"username" ni [concat $elms(required) $elms(optional)]}] parameter::set_value -parameter UseEmailForLoginP -package_id [ad_acs_kernel_id] -value {} aa_true "Param UseEmailForLoginP {} -> true" [auth::UseEmailForLoginP] @@ -692,7 +696,7 @@ # GetElements array set elms [auth::get_registration_elements] - aa_true "Registration elements do NOT contain username" [expr {[lsearch [concat $elms(required) $elms(optional)] "username"] == -1}] + aa_true "Registration elements do NOT contain username" [expr {"username" ni [concat $elms(required) $elms(optional)]}] # Create a user with no username set email [string tolower "[ad_generate_random_string]@foobar.com"]