\PHPMailer\Test\PHPMailerParseAddressesTest

Test RFC822 address splitting.

Summary

Methods
Properties
Constants
testAddressSplittingNative()
testAddressSplittingImap()
testAddressSplittingNativeNoMbstring()
testAddressSplittingImapNoMbstring()
dataAddressSplitting()
No public properties found
No constants found
verifyExpectations()
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

testAddressSplittingNative()

testAddressSplittingNative(string  $addrstr, array  $expected, string  $charset = null) : mixed

Test RFC822 address splitting using the PHPMailer native implementation with the Mbstring extension available.

Parameters

string $addrstr

The address list string.

array $expected

The expected function output.

string $charset

Optional. The charset to use.

Returns

mixed —

testAddressSplittingImap()

testAddressSplittingImap(string  $addrstr, array  $expected, string  $charset = null) : mixed

Test RFC822 address splitting using the IMAP implementation with the Mbstring extension available.

Parameters

string $addrstr

The address list string.

array $expected

The expected function output.

string $charset

Optional. The charset to use.

Returns

mixed —

testAddressSplittingNativeNoMbstring()

testAddressSplittingNativeNoMbstring(string  $addrstr, array  $expected, string  $charset = null) : mixed

Test RFC822 address splitting using the PHPMailer native implementation without the Mbstring extension.

Parameters

string $addrstr

The address list string.

array $expected

The expected function output.

string $charset

Optional. The charset to use.

Returns

mixed —

testAddressSplittingImapNoMbstring()

testAddressSplittingImapNoMbstring(string  $addrstr, array  $expected, string  $charset = null) : mixed

Test RFC822 address splitting using the IMAP implementation without the Mbstring extension.

Parameters

string $addrstr

The address list string.

array $expected

The expected function output.

string $charset

Optional. The charset to use.

Returns

mixed —

dataAddressSplitting()

dataAddressSplitting() : array

Data provider.

Returns

array —

The array is expected to have an addrstr and an expected key. The expected key should - as a minimum - have a default key. Optionally, the following extra keys are supported:

  • native Expected output from the native implementation with or without Mbstring.
  • native+mbstring Expected output from the native implementation with Mbstring.
  • native--mbstring Expected output from the native implementation without Mbstring.
  • imap Expected output from the IMAP implementation with or without Mbstring.
  • imap+mbstring Expected output from the IMAP implementation with Mbstring.
  • imap--mbstring Expected output from the IMAP implementation without Mbstring. Also optionally, an additional charset key can be passed,

verifyExpectations()

verifyExpectations(string  $actual, array  $expected) : mixed

Verify the expectations.

Abstracted out as the same verification needs to be done for every test, just with different data.

Parameters

string $actual

The actual function output.

array $expected

The expected function output.

Returns

mixed —