Пример #1
0
 $resp = $XBAR->post_account($TEMPLATE, $realm_id);
 if ($resp['status'] == 'success') {
     printf("{$bldgrn}PASS: Account Update Returned Success{$txtrst}\n\n");
     $acct = $XBAR->get_account($realm_id);
     /*
     	May need to change this test to make sure 
     	it's not the original/default value America/LosAngles I think
     */
     if ($acct['timezone'] != "America/Vancouver") {
         printf("{$bldred}FAIL: Response failed sanity check {$bldwht}({$bldpur}possibly developers sanity too {$bldwht}){$txtrst}\n\n");
     }
 } else {
     printf("{$bldred}FAIL: Account Update Failed{$txtrst}\n\n");
 }
 printf("{$bldblu}TEST: Delete Account{$txtrst}\n");
 $resp = $XBAR->del_account($realm_id);
 if ($resp['status'] != 'success') {
     $acct = $XBAR->get_account($realm_id);
     if (isset($acct['id'])) {
         printf("{$bldred}FAIL: Account Delete Failed.{$txtrst}\n\n");
     } else {
         printf("{$bldred}FAIL: Account was deleted but returned with an odd response.{$txtrst}\n\n");
     }
 } else {
     printf("{$bldgrn}PASS: Account Delete Success{$txtrst}\n\n");
 }
 printf("{$bldblu}TEST: Recreating Test Account{$txtrst}\n");
 $resp = $XBAR->put_account($TEMPLATE);
 if ($resp['status'] != 'success') {
     printf("{$bldred}FATAL:{$bldwht}Could not re create the test account, aborting test{$txtrst}\n");
     //print_r($resp);