From 715496b76de749c7008ee845f9eea58d41557003 Mon Sep 17 00:00:00 2001 From: rxu Date: Fri, 5 May 2023 21:24:15 +0700 Subject: [PATCH] [ticket/17135] Fix invalid smtp in tests PHPBB3-17135 --- phpBB/includes/functions_messenger.php | 4 ++-- tests/test_framework/phpbb_functional_test_case.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/phpBB/includes/functions_messenger.php b/phpBB/includes/functions_messenger.php index 390463fe3a..dd22f6bb9c 100644 --- a/phpBB/includes/functions_messenger.php +++ b/phpBB/includes/functions_messenger.php @@ -581,7 +581,7 @@ class messenger */ function get_transport($dummy = false) { - if ($dummy) + if ($dummy || empty($this->config['smtp_host'])) { $dsn = 'null://null'; } @@ -600,7 +600,7 @@ class messenger $transport = Transport::fromDsn($dsn); - if ($this->config['smtp_delivery']) + if ($this->config['smtp_delivery'] && $dsn != 'null://null') { // Set ssl context options, see http://php.net/manual/en/context.ssl.php $verify_peer = (bool) $this->config['smtp_verify_peer']; diff --git a/tests/test_framework/phpbb_functional_test_case.php b/tests/test_framework/phpbb_functional_test_case.php index 2ce670d390..ddfca1e0be 100644 --- a/tests/test_framework/phpbb_functional_test_case.php +++ b/tests/test_framework/phpbb_functional_test_case.php @@ -418,7 +418,7 @@ class phpbb_functional_test_case extends phpbb_test_case $iohandler->set_input('email_enable', true); $iohandler->set_input('smtp_delivery', '1'); - $iohandler->set_input('smtp_host', 'nxdomain.phpbb.com'); + $iohandler->set_input('smtp_host', ''); $iohandler->set_input('smtp_auth', 'PLAIN'); $iohandler->set_input('smtp_user', 'nxuser'); $iohandler->set_input('smtp_pass', 'nxpass');