summaryrefslogtreecommitdiffstats
path: root/xt/lib
diff options
context:
space:
mode:
authorMax Kanat-Alexander <mkanat@bugzilla.org>2010-10-02 21:26:51 +0200
committerMax Kanat-Alexander <mkanat@bugzilla.org>2010-10-02 21:26:51 +0200
commit380fca01fdebfb84544c02adced886a64c1ab85e (patch)
tree16a19eb9382108120aeaea3e7af12914fd92cd3d /xt/lib
parenta46cf131f0248614b048f55b30b1b92304292f01 (diff)
downloadbugzilla-380fca01fdebfb84544c02adced886a64c1ab85e.tar.gz
bugzilla-380fca01fdebfb84544c02adced886a64c1ab85e.tar.xz
Bug 601383: Test the chfield* search query parameters in xt/search.t.
r=mkanat, a=mkanat (module owner)
Diffstat (limited to 'xt/lib')
-rw-r--r--xt/lib/Bugzilla/Test/Search/FieldTestNormal.pm16
1 files changed, 15 insertions, 1 deletions
diff --git a/xt/lib/Bugzilla/Test/Search/FieldTestNormal.pm b/xt/lib/Bugzilla/Test/Search/FieldTestNormal.pm
index a4b913caa..22edf2216 100644
--- a/xt/lib/Bugzilla/Test/Search/FieldTestNormal.pm
+++ b/xt/lib/Bugzilla/Test/Search/FieldTestNormal.pm
@@ -28,6 +28,12 @@ use base qw(Bugzilla::Test::Search::FieldTest);
use Scalar::Util qw(blessed);
+use constant CH_OPERATOR => {
+ changedafter => 'chfieldfrom',
+ changedbefore => 'chfieldto',
+ changedto => 'chfieldvalue',
+};
+
# 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
@@ -54,11 +60,19 @@ sub search_params {
my ($self) = @_;
my $field = $self->field;
my $operator = $self->operator;
- $field =~ s/\./_/g;
my $value = $self->translated_value;
if ($operator eq 'anyexact') {
$value = [split(',', $value)];
}
+
+ if (my $ch_param = CH_OPERATOR->{$operator}) {
+ if ($field eq 'creation_ts') {
+ $field = '[Bug creation]';
+ }
+ return { chfield => $field, $ch_param => $value };
+ }
+
+ $field =~ s/\./_/g;
return { $field => $value, "${field}_type" => $self->operator };
}