26 [
'phpunit@' . self::DEFAULT_HOST .
',phpunit', [
27 new \ilMailAddress(
'phpunit', self::DEFAULT_HOST),
28 new \ilMailAddress(
'phpunit', self::DEFAULT_HOST)
30 [
'phpunit@ilias.de', [
31 new \ilMailAddress(
'phpunit',
'ilias.de')
39 new \ilMailAddress(
'#il_ml_4711', self::DEFAULT_HOST)
42 new \ilMailAddress(
'#il_role_1000', self::DEFAULT_HOST)
44 [
'#il_crs_member_998', [
45 new \ilMailAddress(
'#il_crs_member_998', self::DEFAULT_HOST)
47 [
'#member@[French Course]', [
48 new \ilMailAddress(
'#member',
'[French Course]')
50 [
'Course Administrator <#admin@[Math Course]>', [
51 new \ilMailAddress(
'#admin',
'[Math Course]')
53 [
'Course Administrator <#il_crs_admin_2581>', [
54 new \ilMailAddress(
'#il_crs_admin_2581', self::DEFAULT_HOST)
66 [
'phpunit"@ilias.de'],
77 if (!function_exists(
'imap_rfc822_parse_adrlist')) {
78 $this->markTestSkipped(
'Skipped test, imap extension required');
81 $parser = new \ilMailImapRfc822AddressParser($addresses);
82 $parsedAddresses =
$parser->parse();
84 $this->assertCount(count($expected), $parsedAddresses);
85 $this->assertEquals($expected, $parsedAddresses);
95 $parser = new \ilMailPearRfc822WrapperAddressParser($addresses);
96 $parsedAddresses =
$parser->parse();
98 $this->assertCount(count($expected), $parsedAddresses);
99 $this->assertEquals($expected, $parsedAddresses);
108 $this->expectException(ilMailException::class);
119 $wrappedParser = $this->getMockBuilder(\ilBaseMailRfc822AddressParser::class)
120 ->setConstructorArgs([
'phpunit',
'ilias'])
122 $wrappedParser->expects($this->
once())->method(
'parse');
124 $parser = new \ilMailRfc822AddressParser($wrappedParser);
Class ilMailPearRfc822WrapperAddressParser.
testPearAddressParser(string $addresses, array $expected)
once($eventName, callable $callBack, $priority=100)
Subscribe to an event exactly once.
testBuiltInAddressParser(string $addresses, array $expected)
testExceptionShouldBeRaisedIfEmailCannotBeParsedWithPearAddressParser(string $addresses)
emailInvalidAddressesProvider
Class ilMailAddressParserTest.
emailInvalidAddressesProvider()
testWrappingParserDelegatesParsingToAggregatedParser()