mirror of
https://github.com/PHPMailer/PHPMailer.git
synced 2024-09-20 01:52:15 +02:00
Merge pull request #3091 from jrfnl/feature/tests-fix-dkim-test
DKIMTest: two fixes for tests for when OpenSSL is disabled/unavailable
This commit is contained in:
commit
b554b1e6ca
@ -13,7 +13,7 @@
|
||||
|
||||
namespace PHPMailer\Test\PHPMailer;
|
||||
|
||||
use Exception;
|
||||
use PHPMailer\PHPMailer\Exception;
|
||||
use PHPMailer\PHPMailer\PHPMailer;
|
||||
use PHPMailer\Test\SendTestCase;
|
||||
|
||||
@ -240,21 +240,6 @@ final class DKIMTest extends SendTestCase
|
||||
self::assertTrue($this->Mail->send(), 'DKIM signed mail via mail() failed');
|
||||
}
|
||||
|
||||
/**
|
||||
* Verify behaviour of the DKIM_Sign method when Open SSL is not available.
|
||||
*
|
||||
* @covers \PHPMailer\PHPMailer\PHPMailer::DKIM_Sign
|
||||
*/
|
||||
public function testDKIMSignOpenSSLNotAvailable()
|
||||
{
|
||||
if (extension_loaded('openssl')) {
|
||||
$this->markTestSkipped('Test requires OpenSSL *not* to be available');
|
||||
}
|
||||
|
||||
$signature = $this->Mail->DKIM_Sign('foo');
|
||||
self::assertSame('', $signature);
|
||||
}
|
||||
|
||||
/**
|
||||
* Verify behaviour of the DKIM_Sign method when Open SSL is not available and exceptions is enabled.
|
||||
*
|
||||
|
47
test/PHPMailer/DKIMWithoutExceptionsTest.php
Normal file
47
test/PHPMailer/DKIMWithoutExceptionsTest.php
Normal file
@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* PHPMailer - PHP email transport unit tests.
|
||||
* PHP version 5.5.
|
||||
*
|
||||
* @author Marcus Bointon <phpmailer@synchromedia.co.uk>
|
||||
* @author Andy Prevost
|
||||
* @copyright 2012 - 2020 Marcus Bointon
|
||||
* @copyright 2004 - 2009 Andy Prevost
|
||||
* @license https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html GNU Lesser General Public License
|
||||
*/
|
||||
|
||||
namespace PHPMailer\Test\PHPMailer;
|
||||
|
||||
use PHPMailer\PHPMailer\PHPMailer;
|
||||
use PHPMailer\Test\TestCase;
|
||||
|
||||
/**
|
||||
* Test DKIM signing functionality.
|
||||
*
|
||||
* @group dkim
|
||||
*/
|
||||
final class DKIMWithoutExceptionsTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* Whether or not to initialize the PHPMailer object to throw exceptions.
|
||||
*
|
||||
* @var bool|null
|
||||
*/
|
||||
const USE_EXCEPTIONS = false;
|
||||
|
||||
/**
|
||||
* Verify behaviour of the DKIM_Sign method when Open SSL is not available and exceptions is disabled.
|
||||
*
|
||||
* @covers \PHPMailer\PHPMailer\PHPMailer::DKIM_Sign
|
||||
*/
|
||||
public function testDKIMSignOpenSSLNotAvailable()
|
||||
{
|
||||
if (extension_loaded('openssl')) {
|
||||
$this->markTestSkipped('Test requires OpenSSL *not* to be available');
|
||||
}
|
||||
|
||||
$signature = $this->Mail->DKIM_Sign('foo');
|
||||
self::assertSame('', $signature);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user