/** * @depends test_rpcf_add_user_new */ public function test_init_api_user() { $this->_config['login'] = '******' . self::prefix(); $this->_config['password'] = '******' . self::prefix(); $this->_config['admin'] = FALSE; $api_user = URFAClient::init($this->_config); $this->assertInstanceOf('URFAClient_Collector', $api_user); return $api_user; }
<?php require __DIR__ . '/classes/URFAClient.php'; URFAClient::register_autoload();
/** * Делаем финальные проверки и закрываем соединение */ protected function tearDown() { $this->assertTrue(is_array(URFAClient::trace_log())); $this->assertTrue(is_string(URFAClient::last_error())); unset($this->_api); }
Array ( [user_id] => 13 [basic_account] => 13 ) */ print_r(URFAClient::trace_log()); /* Array ( [0] => 2014.07.28 15:30:31 INFO: rpcf_liburfa_list( Array ( ) ) -> Array ( [size] => Array ( [0] => Array ( [module] => liburfa-card [version] => 5.3-002-update5-bsd9 [path] => liburfa-card ) [1] => Array ( [module] => liburfa-dealer [version] => 5.3-002-update5-bsd9 [path] => liburfa-dealer ) [2] => ... ) ) [1] => 2014.07.28 15:30:32 INFO: rpcf_add_user_new( Array ( [login] => test [password] => test [parameters_count] => Array ( ) [groups_count] => Array ( ) ) ) -> Array ( [user_id] => 13 [basic_account] => 13 ) ) */ /********** Пользователь **********/ $urfa = URFAClient::init(array('login' => 'test', 'password' => 'test', 'address' => 'bill.example.org', 'admin' => FALSE)); /* <function name="rpcf_user5_change_password" id="-0x4021"> <input> <string name="old_password" /> <string name="new_password" /> <string name="new_password_ret" /> </input> <output> <integer name="result" /> </output> </function> */ $result = $urfa->rpcf_user5_change_password(array('old_password' => 'test', 'new_password' => 'test_new', 'new_password_ret' => 'test_new')); /* Array