and you may also have to include the registration.php file from /wp-includes, as the function might not yet exist.
require_once( ABSPATH . WPINC . '/registration.php');
before you call wp_update_user.
the wp_update_user() function hasn’t been loaded.
if you require the /wp-includes/registration.php file like this:
require_once( ABSPATH . WPINC . '/registration.php');
you should be able to use wp_update_user.
You need to pass it an array of userdata.
So instead of your wp_update_user($user_ID, 'user_nicename', 'test');
give it
wp_update_user(array(‘ID’ => $user_ID, ‘user_nicename’ => ‘test’));