File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -401,6 +401,21 @@ function drupal_get_env(string|array $variables) : mixed {
401401 $ config ['helfi_search.settings ' ]['openai_model ' ] = getenv ('OPENAI_MODEL ' );
402402}
403403
404+ // E2E test users. We should never do this in production, so adding a failsafe
405+ // in case the environment variable would ever end up in production.
406+ if (getenv ('APP_ENV ' ) !== 'production ' && $ e2e_test_user = getenv ('E2E_TEST_USER ' )) {
407+ $ e2e_test_user = json_decode ($ e2e_test_user , TRUE );
408+
409+ // Make sure the user exists in Drupal.
410+ $ config ['helfi_api_base.api_accounts ' ]['accounts ' ][] = $ e2e_test_user ;
411+
412+ // Some features need to be modified for the test user.
413+ // @see Drupal\helfi_tfa\Hook\UserHooks::userLogin().
414+ $ config ['helfi_platform_config.e2e_test_users ' ]['users ' ][] = array_intersect_key ($ e2e_test_user , [
415+ "username " => TRUE ,
416+ ]);
417+ }
418+
404419// Environment specific overrides.
405420if (file_exists (__DIR__ . '/all.settings.php ' )) {
406421 // phpcs:ignore
You can’t perform that action at this time.
0 commit comments