summaryrefslogtreecommitdiffstats
path: root/xt/lib/Bugzilla/Test/Search/FieldTestNormal.pm
diff options
context:
space:
mode:
authorMax Kanat-Alexander <mkanat@bugzilla.org>2010-10-02 19:03:12 +0200
committerMax Kanat-Alexander <mkanat@bugzilla.org>2010-10-02 19:03:12 +0200
commit204093007aeeb87329fa06c8dd9a4fd8df94a85f (patch)
tree9ca721cd2dd7706b2f71a1528d82e3038194c371 /xt/lib/Bugzilla/Test/Search/FieldTestNormal.pm
parentb96b7a4b70e95918190effa67520c2fbf30cdcab (diff)
downloadbugzilla-204093007aeeb87329fa06c8dd9a4fd8df94a85f.tar.gz
bugzilla-204093007aeeb87329fa06c8dd9a4fd8df94a85f.tar.xz
Bug 601376: Test the __all__, __open__, and __closed__ arguments to
bug_status in xt/search.t r=mkanat, a=mkanat (module owner)
Diffstat (limited to 'xt/lib/Bugzilla/Test/Search/FieldTestNormal.pm')
-rw-r--r--xt/lib/Bugzilla/Test/Search/FieldTestNormal.pm20
1 files changed, 15 insertions, 5 deletions
diff --git a/xt/lib/Bugzilla/Test/Search/FieldTestNormal.pm b/xt/lib/Bugzilla/Test/Search/FieldTestNormal.pm
index b42db08e2..a4b913caa 100644
--- a/xt/lib/Bugzilla/Test/Search/FieldTestNormal.pm
+++ b/xt/lib/Bugzilla/Test/Search/FieldTestNormal.pm
@@ -26,12 +26,22 @@ use strict;
use warnings;
use base qw(Bugzilla::Test::Search::FieldTest);
-# We just clone a FieldTest because that's the best for performance,
-# overall--that way we don't have to translate the value again.
+use Scalar::Util qw(blessed);
+
+# Normally, we just clone a FieldTest because that's the best for performance,
+# overall--that way we don't have to translate the value again. However,
+# sometimes (like in Bugzilla::Test::Search's direct code) we just want
+# to create a FieldTestNormal.
sub new {
- my ($class, $field_test) = @_;
- my $self = { %$field_test };
- return bless $self, $class;
+ my $class = shift;
+ my ($first_arg) = @_;
+ if (blessed $first_arg
+ and $first_arg->isa('Bugzilla::Test::Search::FieldTest'))
+ {
+ my $self = { %$first_arg };
+ return bless $self, $class;
+ }
+ return $class->SUPER::new(@_);
}
sub name {