_acs-authentication__auth_password_implementations (private)

 _acs-authentication__auth_password_implementations

Defined in packages/acs-authentication/tcl/test/local-procs.tcl

Partial Call Graph (max 5 caller/called nodes):
%3 aa_equals aa_equals (public) aa_log aa_log (public) aa_log_result aa_log_result (public) aa_run_with_teardown aa_run_with_teardown (public) aa_section aa_section (public) _acs-authentication__auth_password_implementations _acs-authentication__auth_password_implementations _acs-authentication__auth_password_implementations->aa_equals _acs-authentication__auth_password_implementations->aa_log _acs-authentication__auth_password_implementations->aa_log_result _acs-authentication__auth_password_implementations->aa_run_with_teardown _acs-authentication__auth_password_implementations->aa_section

Testcases:
No testcase defined.
Source code:
        
        set _aa_export {}
        set body_count 1
        foreach testcase_body {{
        aa_stub acs_mail_lite::send {
            set ::auth_password_implementations_to_addr $to_addr
            set ::auth_password_implementations_body $body
        }

        aa_true "CanChangePassword is always true" [acs_sc::invoke  -contract auth_password  -operation CanChangePassword  -impl local  -call_args [list ""]]
        aa_true "CanResetPassword is always true" [acs_sc::invoke  -contract auth_password  -operation CanResetPassword  -impl local  -call_args [list ""]]
        aa_true "CanRetrievePassword is always true" [acs_sc::invoke  -contract auth_password  -operation CanRetrievePassword  -impl local  -call_args [list ""]]

        aa_equals "GetParameters returns nothing"  [acs_sc::invoke  -contract auth_password  -operation GetParameters  -impl local]  ""

        aa_run_with_teardown -rollback -test_code {
            set user [acs::test::user::create]
            set user_id [dict get $user user_id]
            set old_password [dict get $user password]
            set user [acs_user::get -user_id $user_id]

            set username [dict get $user username]
            set authority_id [dict get $user authority_id]

            aa_section "Changing password"
            set new_password 1234
            acs_sc::invoke  -contract auth_password  -operation ChangePassword  -impl local  -call_args [list  $username  $new_password  $old_password  [list]  $authority_id]
            aa_true "Password was changed" [ad_check_password $user_id $new_password]

            aa_section "Resetting password"
            set result [acs_sc::invoke  -contract auth_password  -operation ResetPassword  -impl local  -call_args [list  $username  [list]  $authority_id]]
            set new_password [dict get $result password]
            aa_true "Password was reset" [ad_check_password $user_id $new_password]

            aa_section "Retrieving password"
            acs_sc::invoke  -contract auth_password  -operation RetrievePassword  -impl local  -call_args [list $username [list]]
            set email [dict get $user email]
            set password [dict get $user password]
            aa_equals "Email was sent to the user"  [dict get $user email] $::auth_password_implementations_to_addr
            set password [db_string query {
                select password from users where user_id = :user_id
            }]
            aa_true "Email contains a link to the password hash"  {[string first  [ns_urlencode $password]  $::auth_password_implementations_body] >= 0}
        }
    }} {
          aa_log "Running testcase body $body_count"
          set ::__aa_test_indent [info level]
          set catch_val [catch $testcase_body msg]
          if {$catch_val != 0 && $catch_val != 2} {
              aa_log_result "fail" "auth_password_implementations (body $body_count): Error during execution: $msg, stack trace: \n$::errorInfo"
          }
          incr body_count
        }
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: