diff options
| author | Mark Wells <mark@freeside.biz> | 2012-09-29 16:36:46 -0700 |
|---|---|---|
| committer | Mark Wells <mark@freeside.biz> | 2012-09-29 16:36:46 -0700 |
| commit | 33beebf4cb42eba3e1dd868ad5e0af102de961da (patch) | |
| tree | 860712543dcc74ff2402a4ed8d73e8cd553e62d4 /rt/t/api/emailparser.t | |
| parent | 7ac86daf67b0a95153b736d5811f9050363f6553 (diff) | |
update address standardization for cust_location changes
Diffstat (limited to 'rt/t/api/emailparser.t')
| -rw-r--r-- | rt/t/api/emailparser.t | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/rt/t/api/emailparser.t b/rt/t/api/emailparser.t index 940c26fde..790314603 100644 --- a/rt/t/api/emailparser.t +++ b/rt/t/api/emailparser.t @@ -2,7 +2,7 @@ use strict; use warnings; -use RT::Test tests => 4; +use RT::Test nodb => 1, tests => 10; RT->Config->Set( RTAddressRegexp => qr/^rt\@example.com$/i ); @@ -14,6 +14,23 @@ is(RT::EmailParser::IsRTAddress("","frt\@example.com"),undef, "Regexp didn't mat my @before = ("rt\@example.com", "frt\@example.com"); my @after = ("frt\@example.com"); -ok(eq_array(RT::EmailParser::CullRTAddresses("",@before),@after), "CullRTAddresses only culls RT addresses"); +ok(eq_array(RT::EmailParser->CullRTAddresses(@before),@after), "CullRTAddresses only culls RT addresses"); + +{ + require RT::Interface::Email; + my ( $addr, $name ) = + RT::Interface::Email::ParseAddressFromHeader('foo@example.com'); + is( $addr, 'foo@example.com', 'addr for foo@example.com' ); + is( $name, undef, 'no name for foo@example.com' ); + + ( $addr, $name ) = + RT::Interface::Email::ParseAddressFromHeader('Foo <foo@example.com>'); + is( $addr, 'foo@example.com', 'addr for Foo <foo@example.com>' ); + is( $name, 'Foo', 'name for Foo <foo@example.com>' ); + + ( $addr, $name ) = + RT::Interface::Email::ParseAddressFromHeader('foo@example.com (Comment)'); + is( $addr, 'foo@example.com', 'addr for foo@example.com (Comment)' ); + is( $name, undef, 'no name for foo@example.com (Comment)' ); +} -1; |
