Skip to content

Commit

Permalink
set wp-env tests constants for the test environment, to ensure that e…
Browse files Browse the repository at this point in the history
…mails can be sent without needing a filter override.
  • Loading branch information
dd32 committed Aug 22, 2024
1 parent d7f04b5 commit a2dcc9a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
12 changes: 11 additions & 1 deletion .wp-env.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
{
"phpVersion": "7.4",
"plugins": [ "." ]
"plugins": [ "." ],
"env": {
"tests": {
"config": {
"WP_TESTS_EMAIL": "[email protected]",
"WP_TESTS_DOMAIN": "example.org",
"WP_SITEURL": "https://example.org",
"WP_HOME": "https://example.org"
}
}
}
}
12 changes: 0 additions & 12 deletions tests/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,5 @@ function() {
}
);

// Ensure that emails can be sent.
tests_add_filter(
'wp_mail_from',
function( $email ) {
if ( false !== strpos( $email, '@localhost' ) ) {
$email = str_replace( '@localhost', '@example.org', $email );
}

return $email;
}
);

// Start up the WP testing environment.
require_once $_tests_dir . '/includes/bootstrap.php';

0 comments on commit a2dcc9a

Please sign in to comment.