From dbaf1c3aaf975ed78d8e8538b2df18ab9f47654b Mon Sep 17 00:00:00 2001 From: Max Kanat-Alexander Date: Thu, 15 Jul 2010 19:55:10 -0700 Subject: Bug 398308: Make Search.pm take a hashref for its "params" argument instead of taking a CGI object. r=mkanat, a=mkanat (module owner) --- xt/lib/Bugzilla/Test/Search/FakeCGI.pm | 61 ---------------------------------- 1 file changed, 61 deletions(-) delete mode 100644 xt/lib/Bugzilla/Test/Search/FakeCGI.pm (limited to 'xt/lib/Bugzilla/Test/Search/FakeCGI.pm') diff --git a/xt/lib/Bugzilla/Test/Search/FakeCGI.pm b/xt/lib/Bugzilla/Test/Search/FakeCGI.pm deleted file mode 100644 index e20a57daf..000000000 --- a/xt/lib/Bugzilla/Test/Search/FakeCGI.pm +++ /dev/null @@ -1,61 +0,0 @@ -# -*- Mode: perl; indent-tabs-mode: nil -*- -# -# The contents of this file are subject to the Mozilla Public -# License Version 1.1 (the "License"); you may not use this file -# except in compliance with the License. You may obtain a copy of -# the License at http://www.mozilla.org/MPL/ -# -# Software distributed under the License is distributed on an "AS -# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or -# implied. See the License for the specific language governing -# rights and limitations under the License. -# -# The Original Code is the Bugzilla Bug Tracking System. -# -# The Initial Developer of the Original Code is Everything Solved, Inc. -# Portions created by the Initial Developer are Copyright (C) 2010 the -# Initial Developer. All Rights Reserved. -# -# Contributor(s): -# Max Kanat-Alexander - -# Calling CGI::param over and over turned out to be one of the slowest -# parts of search.t. So we create a simpler thing here that just supports -# "param" in a fast way. -package Bugzilla::Test::Search::FakeCGI; - -sub new { - my ($class) = @_; - return bless {}, $class; -} - -sub param { - my ($self, $name, @values) = @_; - if (!defined $name) { - return keys %$self; - } - - if (@values) { - if (ref $values[0] eq 'ARRAY') { - $self->{$name} = $values[0]; - } - else { - $self->{$name} = \@values; - } - } - - return () if !exists $self->{$name}; - - my $item = $self->{$name}; - return wantarray ? @{ $item || [] } : $item->[0]; -} - -sub delete { - my ($self, $name) = @_; - delete $self->{$name}; -} - -# We don't need to do this, because we don't use old params in search.t. -sub convert_old_params {} - -1; \ No newline at end of file -- cgit v1.2.3-24-g4f1b