[ticket/17135] Fix invalid smtp in tests

PHPBB3-17135
This commit is contained in:
rxu 2023-05-05 21:24:15 +07:00
parent df5ab5b5d8
commit 715496b76d
No known key found for this signature in database
GPG key ID: 955F0567380E586A
2 changed files with 3 additions and 3 deletions

View file

@ -581,7 +581,7 @@ class messenger
*/ */
function get_transport($dummy = false) function get_transport($dummy = false)
{ {
if ($dummy) if ($dummy || empty($this->config['smtp_host']))
{ {
$dsn = 'null://null'; $dsn = 'null://null';
} }
@ -600,7 +600,7 @@ class messenger
$transport = Transport::fromDsn($dsn); $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 // Set ssl context options, see http://php.net/manual/en/context.ssl.php
$verify_peer = (bool) $this->config['smtp_verify_peer']; $verify_peer = (bool) $this->config['smtp_verify_peer'];

View file

@ -418,7 +418,7 @@ class phpbb_functional_test_case extends phpbb_test_case
$iohandler->set_input('email_enable', true); $iohandler->set_input('email_enable', true);
$iohandler->set_input('smtp_delivery', '1'); $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_auth', 'PLAIN');
$iohandler->set_input('smtp_user', 'nxuser'); $iohandler->set_input('smtp_user', 'nxuser');
$iohandler->set_input('smtp_pass', 'nxpass'); $iohandler->set_input('smtp_pass', 'nxpass');