From 204093007aeeb87329fa06c8dd9a4fd8df94a85f Mon Sep 17 00:00:00 2001 From: Max Kanat-Alexander Date: Sat, 2 Oct 2010 10:03:12 -0700 Subject: Bug 601376: Test the __all__, __open__, and __closed__ arguments to bug_status in xt/search.t r=mkanat, a=mkanat (module owner) --- xt/lib/Bugzilla/Test/Search.pm | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'xt/lib/Bugzilla/Test/Search.pm') diff --git a/xt/lib/Bugzilla/Test/Search.pm b/xt/lib/Bugzilla/Test/Search.pm index 467615ba0..5137302b7 100644 --- a/xt/lib/Bugzilla/Test/Search.pm +++ b/xt/lib/Bugzilla/Test/Search.pm @@ -58,6 +58,7 @@ use Bugzilla::FlagType; use Bugzilla::Group; use Bugzilla::Install (); use Bugzilla::Test::Search::Constants; +use Bugzilla::Test::Search::FieldTestNormal; use Bugzilla::Test::Search::OperatorTest; use Bugzilla::User (); use Bugzilla::Util qw(generate_random_password); @@ -108,7 +109,11 @@ sub num_tests { my $sql_injection_tests = scalar(@fields) * scalar(@top_operators) * scalar(@injection_values) * NUM_SEARCH_TESTS; - return $operator_field_tests + $sql_injection_tests; + # This @{ [] } thing is the only reasonable way to get a count out of a + # constant array. + my $special_tests = scalar(@{ [SPECIAL_PARAM_TESTS] }) * TESTS_PER_RUN; + + return $operator_field_tests + $sql_injection_tests + $special_tests; } sub _total_operator_tests { @@ -852,6 +857,14 @@ sub run { # Even though _setup_bugs set us as an admin, we want to be sure at # this point that we have an admin with refreshed group memberships. Bugzilla->set_user($self->admin); + foreach my $test (SPECIAL_PARAM_TESTS) { + my $operator_test = + new Bugzilla::Test::Search::OperatorTest($test->{operator}, $self); + my $field = Bugzilla::Field->check($test->{field}); + my $special_test = new Bugzilla::Test::Search::FieldTestNormal( + $operator_test, $field, $test); + $special_test->run(); + } foreach my $operator ($self->top_level_operators) { my $operator_test = new Bugzilla::Test::Search::OperatorTest($operator, $self); -- cgit v1.2.3-24-g4f1b