19 declare(strict_types=1);
33 'Username Addresses' => [
34 'phpunit@' . self::DEFAULT_HOST .
',phpunit',
46 'Email Addresses with Umlauts' => [
47 'phpünit@ilias.de,phpnitü@ilias.de,üphpnit@iliäs.de',
54 'Trailing Dot in Local Part of Email Address' => [
60 'Mailing List Address' => [
72 'Local Role Address' => [
78 'Course Role Address With Role Names for Course and Role' => [
79 '#member@[French Course]',
84 'Course Role Recipient with Course Role Address (Role Names for Course and Role)' => [
85 'Course Administrator <#admin@[Math Course]>',
90 'Course Role Recipient with Course Role Address (Numeric Id for Course Role)' => [
91 'Course Administrator <#il_crs_admin_2581>',
96 'sepp@some.where;done@web.de' => [
98 'sepp@some.where;done@web.de',
113 'Trailing Quote in Local Part' => [
116 'Trailing Quote in Local Part of Email Address' => [
122 #[DataProvider('emailAddressesProvider')] 125 if (!function_exists(
'imap_rfc822_parse_adrlist')) {
126 $this->markTestSkipped(
'Skipped test, imap extension required');
130 $parsed_addresses = $parser->parse();
132 $this->assertCount(count($expected), $parsed_addresses);
133 $this->assertEquals($expected, $parsed_addresses);
136 #[DataProvider('emailAddressesProvider')] 140 $parsed_addresses = $parser->parse();
142 $this->assertEquals($expected, $parsed_addresses);
143 $this->assertCount(count($expected), $parsed_addresses);
149 $parsed_addresses = $parser->parse();
151 $this->assertCount(0, $parsed_addresses);
154 #[DataProvider('emailInvalidAddressesProvider')] 157 $this->expectException(ilMailException::class);
165 $wrapped_parser = $this->getMockBuilder(ilBaseMailRfc822AddressParser::class)
166 ->setConstructorArgs([
'phpunit',
'ilias'])
168 $wrapped_parser->expects($this->once())->method(
'parse');
testPearAddressParser(string $addresses, array $expected)
testBuiltInAddressParser(string $addresses, array $expected)
testExceptionShouldBeRaisedIfEmailCannotBeParsedWithPearAddressParser(string $addresses)
testAddressParserReturnsEmptyListIfAnEmptyAddressStringIsGiven()
static emailInvalidAddressesProvider()
const string DEFAULT_HOST
static emailAddressesProvider()
testWrappingParserDelegatesParsingToAggregatedParser()