Removing Tests. Reintroducing them fixed in #3197
This commit is contained in:
parent
0ce6905391
commit
69a2b8038f
|
|
@ -1288,7 +1288,7 @@ class PHPMailer
|
|||
|
||||
/**
|
||||
* Parse a string containing one or more RFC822-style comma-separated email addresses
|
||||
* of the form "display name <address>" into an array of name/address pairs.
|
||||
* with the form "display name <address>" into an array of name/address pairs.
|
||||
* Uses a simpler parser that does not require the IMAP extension but doesnt support
|
||||
* the full RFC822 spec. For full RFC822 support, use the PHP IMAP extension.
|
||||
*
|
||||
|
|
@ -1301,6 +1301,7 @@ class PHPMailer
|
|||
{
|
||||
// Emit a runtime notice to recommend using the IMAP extension for full RFC822 parsing
|
||||
trigger_error(self::lang('imap_recommended'), E_USER_NOTICE);
|
||||
|
||||
$list = explode(',', $addrstr);
|
||||
foreach ($list as $address) {
|
||||
$address = trim($address);
|
||||
|
|
|
|||
|
|
@ -28,36 +28,6 @@ use Yoast\PHPUnitPolyfills\TestCases\TestCase;
|
|||
*/
|
||||
final class ParseAddressesTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* Test RFC822 address splitting using the PHPMailer native implementation
|
||||
* with the Mbstring extension available.
|
||||
*
|
||||
* @requires extension mbstring
|
||||
*
|
||||
* @dataProvider dataAddressSplitting
|
||||
*
|
||||
* @param string $addrstr The address list string.
|
||||
* @param array $expected The expected function output.
|
||||
* @param string $charset Optional. The charset to use.
|
||||
*/
|
||||
public function testAddressSplittingNative($addrstr, $expected, $charset = null)
|
||||
{
|
||||
if (isset($charset)) {
|
||||
$parsed = PHPMailer::parseAddresses($addrstr, false, $charset);
|
||||
} else {
|
||||
$parsed = PHPMailer::parseAddresses($addrstr, false);
|
||||
}
|
||||
|
||||
$expectedOutput = $expected['default'];
|
||||
if (empty($expected['native+mbstring']) === false) {
|
||||
$expectedOutput = $expected['native+mbstring'];
|
||||
} elseif (empty($expected['native']) === false) {
|
||||
$expectedOutput = $expected['native'];
|
||||
}
|
||||
|
||||
$this->verifyExpectations($parsed, $expectedOutput);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test RFC822 address splitting using the IMAP implementation
|
||||
* with the Mbstring extension available.
|
||||
|
|
@ -89,38 +59,6 @@ final class ParseAddressesTest extends TestCase
|
|||
$this->verifyExpectations($parsed, $expectedOutput);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test RFC822 address splitting using the PHPMailer native implementation
|
||||
* without the Mbstring extension.
|
||||
*
|
||||
* @dataProvider dataAddressSplitting
|
||||
*
|
||||
* @param string $addrstr The address list string.
|
||||
* @param array $expected The expected function output.
|
||||
* @param string $charset Optional. The charset to use.
|
||||
*/
|
||||
public function testAddressSplittingNativeNoMbstring($addrstr, $expected, $charset = null)
|
||||
{
|
||||
if (extension_loaded('mbstring')) {
|
||||
self::markTestSkipped('Test requires MbString *not* to be available');
|
||||
}
|
||||
|
||||
if (isset($charset)) {
|
||||
$parsed = PHPMailer::parseAddresses($addrstr, false, $charset);
|
||||
} else {
|
||||
$parsed = PHPMailer::parseAddresses($addrstr, false);
|
||||
}
|
||||
|
||||
$expectedOutput = $expected['default'];
|
||||
if (empty($expected['native--mbstring']) === false) {
|
||||
$expectedOutput = $expected['native--mbstring'];
|
||||
} elseif (empty($expected['native']) === false) {
|
||||
$expectedOutput = $expected['native'];
|
||||
}
|
||||
|
||||
$this->verifyExpectations($parsed, $expectedOutput);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test RFC822 address splitting using the IMAP implementation
|
||||
* without the Mbstring extension.
|
||||
|
|
|
|||
Loading…
Reference in New Issue