aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authormkanat%bugzilla.org <>2009-01-29 21:22:19 +0000
committermkanat%bugzilla.org <>2009-01-29 21:22:19 +0000
commitfc293fbd39f14308fbccd0cf9b523664ae813761 (patch)
tree2eff5448dfbcf0fb0a0671fad80da0752db8f727 /t
parentBug 473201: config.rdf.tmpl flag_type should include group information - Patc... (diff)
downloadbugzilla-fc293fbd39f14308fbccd0cf9b523664ae813761.tar.gz
bugzilla-fc293fbd39f14308fbccd0cf9b523664ae813761.tar.bz2
bugzilla-fc293fbd39f14308fbccd0cf9b523664ae813761.zip
Bug 219021: Only display email addresses to logged-in users
Patch By Max Kanat-Alexander <mkanat@bugzilla.org> r=LpSolit, a=LpSolit
Diffstat (limited to 't')
-rw-r--r--t/007util.t26
1 files changed, 20 insertions, 6 deletions
diff --git a/t/007util.t b/t/007util.t
index dad5dfb02..c0433639b 100644
--- a/t/007util.t
+++ b/t/007util.t
@@ -13,11 +13,11 @@
# The Original Code are the Bugzilla Tests.
#
# The Initial Developer of the Original Code is Zach Lipton
-# Portions created by Zach Lipton are
-# Copyright (C) 2002 Zach Lipton. All
-# Rights Reserved.
+# Portions created by Zach Lipton are Copyright (C) 2002 Zach Lipton.
+# All Rights Reserved.
#
# Contributor(s): Zach Lipton <zach@zachlipton.com>
+# Max Kanat-Alexander <mkanat@bugzilla.org>
#################
@@ -26,11 +26,11 @@
use lib 't';
use Support::Files;
+use Test::More tests => 16;
BEGIN {
- use Test::More tests => 12;
- use_ok(Bugzilla);
- use_ok(Bugzilla::Util);
+ use_ok(Bugzilla);
+ use_ok(Bugzilla::Util);
}
# We need to override user preferences so we can get an expected value when
@@ -64,3 +64,17 @@ is(format_time("2002.11.24 00:05"), "2002-11-24 00:05 $tz",'format_time("2002.11
is(format_time("2002.11.24 00:05:56"), "2002-11-24 00:05:56 $tz",'format_time("2002.11.24 00:05:56")');
is(format_time("2002.11.24 00:05:56", "%Y-%m-%d %R"), '2002-11-24 00:05', 'format_time("2002.11.24 00:05:56", "%Y-%m-%d %R") (with no timezone)');
is(format_time("2002.11.24 00:05:56", "%Y-%m-%d %R %Z"), "2002-11-24 00:05 $tz", 'format_time("2002.11.24 00:05:56", "%Y-%m-%d %R %Z") (with timezone)');
+
+# email_filter
+my %email_strings = (
+ 'somebody@somewhere.com' => 'somebody',
+ 'Somebody <somebody@somewhere.com>' => 'Somebody <somebody>',
+ 'One Person <one@person.com>, Two Person <two@person.com>'
+ => 'One Person <one>, Two Person <two>',
+ 'This string contains somebody@somewhere.com and also this@that.com'
+ => 'This string contains somebody and also this',
+);
+foreach my $input (keys %email_strings) {
+ is(Bugzilla::Util::email_filter($input), $email_strings{$input},
+ "email_filter('$input')");
+}