summaryrefslogtreecommitdiffstats
path: root/xt/lib
diff options
context:
space:
mode:
authorMax Kanat-Alexander <mkanat@bugzilla.org>2010-07-15 13:13:29 +0200
committerMax Kanat-Alexander <mkanat@bugzilla.org>2010-07-15 13:13:29 +0200
commited9e593a9324dffd0d2c0087889e4b6798e25f2f (patch)
tree744c3bfe72340d8c984b2846f53ca4a787f23d50 /xt/lib
parenta8577a8e73b15608c09f70b9c326196832934407 (diff)
downloadbugzilla-ed9e593a9324dffd0d2c0087889e4b6798e25f2f.tar.gz
bugzilla-ed9e593a9324dffd0d2c0087889e4b6798e25f2f.tar.xz
Bug 577800: Finish the cleanup of Search.pm's "init" function by removing
it and having its work be done by a new "sql" accessor instead. Also adds some comments, moves functions around into sections, and creates a new _user accessor. r=mkanat, a=mkanat (module owner)
Diffstat (limited to 'xt/lib')
-rw-r--r--xt/lib/Bugzilla/Test/Search/FieldTest.pm15
1 files changed, 6 insertions, 9 deletions
diff --git a/xt/lib/Bugzilla/Test/Search/FieldTest.pm b/xt/lib/Bugzilla/Test/Search/FieldTest.pm
index 7ebf760d1..4d24c5bd3 100644
--- a/xt/lib/Bugzilla/Test/Search/FieldTest.pm
+++ b/xt/lib/Bugzilla/Test/Search/FieldTest.pm
@@ -497,20 +497,17 @@ sub do_tests {
my $search_broken = $self->search_known_broken;
- my $search;
+ my $search = $self->_test_search_object_creation();
+
+ my $sql;
TODO: {
local $TODO = $search_broken if $search_broken;
- $search = $self->_test_search_object_creation();
+ lives_ok { $sql = $search->sql } "$name: generate SQL";
}
- my ($results, $sql);
+ my $results;
SKIP: {
- skip "Can't run SQL without Search object", 2 if !$search;
- lives_ok { $sql = $search->getSQL() } "$name: get SQL";
-
- # This prevents warnings from DBD::mysql if we pass undef $sql,
- # which happens if "new Bugzilla::Search" fails.
- $sql ||= '';
+ skip "Can't run SQL without any SQL", 1 if !defined $sql;
$results = $self->_test_sql($sql);
}