How I can create a user programatically in drupal 8. I am using the following code to generate user registration form.
$account = $this->entityTypeManager->getStorage('user')->create([]);
$form = $this->entityFormBuilder->getForm($account, 'register');
and form_sate values using the following code.
$form_state = (new FormState())->setValues(['name' => 'user1', 'pass' => 'pass']);
Now how can submit this form using the above form_state values?