1
2=head1 NAME
3
4WWW::Search::Null::Empty - class for testing WWW::Search clients
5
6=head1 SYNOPSIS
7
8  use WWW::Search;
9  my $oSearch = new WWW::Search('Null::Empty');
10  $oSearch->native_query('Makes no difference what you search for...');
11  my @aoResults = $oSearch->results;
12  # You get no results...
13  my $oResponse = $oSearch->response;
14  # ...But you get an HTTP::Response object with a code of 200
15
16=head1 DESCRIPTION
17
18This class is a specialization of WWW::Search that returns no hits,
19but no error message.
20
21This module might be useful for testing a client program without
22actually being connected to any particular search engine.
23
24=head1 AUTHOR
25
26Martin 'Kingpin' Thurn, C<mthurn at cpan.org>, L<http://tinyurl.com/nn67z>.
27
28=cut
29
30package WWW::Search::Null::Empty;
31
32use strict;
33use warnings;
34
35use base 'WWW::Search';
36
37our
38$VERSION = 1.11;
39our
40$MAINTAINER = q{Martin Thurn <mthurn@cpan.org>};
41
42sub _native_setup_search
43  {
44  my($self, $native_query, $native_opt) = @_;
45  } # native_setup_search
46
47
48sub _native_retrieve_some
49  {
50  my $self = shift;
51  my $response = new HTTP::Response(200,
52                                    "This is a test of WWW::Search");
53  $self->{response} = $response;
54  # Explicitly set the number of results:
55  $self->{'approx_count'} = 0;
56  return 0;
57  } # native_retrieve_some
58
59
601;
61
62__END__
63
64