File: TCaptcha.pm

package info (click to toggle)
libcaptcha-recaptcha-perl 0.98%2Bds-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 176 kB
  • sloc: perl: 274; makefile: 2
file content (30 lines) | stat: -rw-r--r-- 573 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package Test::TCaptcha;

@ISA = qw(Captcha::reCAPTCHA);
use Captcha::reCAPTCHA;
use HTTP::Response;

sub set_response {
  my $self     = shift;
  my $response = shift;
  $self->{t_response} = $response;
}

sub _post_request {
  my $self = shift;
  my $url  = shift;
  my $args = shift;

  # Just keep the args
  $self->{t_url}  = $url;
  $self->{t_args} = $args;

  my $r = HTTP::Response->new( 200, 'OK');
  $r->header('Content-type' => 'text/plain');
  $r->content( $self->{t_response} );

  return $r;
}

sub get_url  { shift->{t_url} }
sub get_args { shift->{t_args} }