/[webpac2]/trunk/lib/WebPAC/Input/Test.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/lib/WebPAC/Input/Test.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 796 by dpavlin, Sun Feb 4 12:42:43 2007 UTC revision 798 by dpavlin, Sun Feb 4 13:31:38 2007 UTC
# Line 4  use warnings; Line 4  use warnings;
4  use strict;  use strict;
5    
6  use WebPAC::Input;  use WebPAC::Input;
7    use WebPAC::Common;
8  use base qw/WebPAC::Common/;  use base qw/WebPAC::Common/;
9    use Data::Dump qw/dump/;
10    
11  =head1 NAME  =head1 NAME
12    
# Line 36  Setup test record Line 38  Setup test record
38    
39  Setup optional size  Setup optional size
40    
41    $WebPAC::Input::Test::Size = 42;    $WebPAC::Input::Test::size = 42;
42    
43  =head1 FUNCTIONS  =head1 FUNCTIONS
44    
# Line 51  Setup optional size Line 53  Setup optional size
53          },          },
54    }    }
55    
56    C<filter> will be assigned to C<$WebPAC::Input::Test::filter>
57    
58  =cut  =cut
59    
60    our $filter;
61    
62  sub new {  sub new {
63          my $class = shift;          my $class = shift;
64          my $self = {@_};          my $self = {@_};
# Line 60  sub new { Line 66  sub new {
66    
67          my $arg = {@_};          my $arg = {@_};
68    
69            $filter = $arg->{filter};
70    
71          $self->_get_logger()->info("mocking Test database with args = ", dump($arg));          $self->_get_logger()->info("mocking Test database with args = ", dump($arg));
72    
73          $self ? return $self : return undef;          $self ? return $self : return undef;
# Line 71  Return record with ID C<$mfn> from datab Line 79  Return record with ID C<$mfn> from datab
79    
80    my $rec = $isis->fetch_rec( $mfn );    my $rec = $isis->fetch_rec( $mfn );
81    
82  Second argument, C<filter_coderef> is ignored.  Second argument, C<filter_coderef> will be assigned to
83    C<$WebPAC::Input::Test::filer_coderef>
84    
85  =cut  =cut
86    
87  my $rec;  our $rec;
88    our $filter_coderef;
89    
90  sub fetch_rec {  sub fetch_rec {
91          my $self = shift;          my $self = shift;
92    
93          my ($mfn, $filter_coderef) = @_;          my $mfn = shift;
94            $filter_coderef = shift;
95    
96          $self->_get_logger()->info("mfn = $mfn");          $self->_get_logger()->debug("mfn = $mfn rec = ", dump($rec));
97    
98          return $rec;          return $rec;
99  }  }
# Line 109  Return number of records in database Line 120  Return number of records in database
120    
121  =cut  =cut
122    
123  my $size = 1;  our $size = 1;
124    
125  sub size {  sub size {
126          my $self = shift;          my $self = shift;
127          $self->_get_logger()->info("size = $size");          $self->_get_logger()->debug("size = $size");
128          return $size;          return $size;
129  }  }
130    

Legend:
Removed from v.796  
changed lines
  Added in v.798

  ViewVC Help
Powered by ViewVC 1.1.26