package URI::Fetch; # Dummy URI::Fetch module for test. use strict; use vars qw($VERSION @dummy); $VERSION = 0.03; sub set_dummy { my $class = shift; my $ref = shift; @dummy = @$ref; } sub fetch { my $class = shift; my $url = shift; my $ref = shift(@dummy); $ref->{'url'} = $url; bless $ref,$class; } sub URI_GONE { 410 } sub http_response { shift } sub request { shift } sub uri { shift } sub headers { shift } sub status { shift->{'status'} || 200 } sub as_string { my $self = shift; $self->{'url'} ? $self->{'url'} eq 'http://redirect.example.com/' ? 'http://redirected.example.com/' : $self->{'url'} : "http://example.com/" } sub content { shift->{'content'} || ' http://openid.net/signon/1.1 http://openid.net/signon/1.0 http://example.com/server http://example.com/server2 http://my.example.com/ ' } sub scan { my $self = shift; my $ref = shift; $ref->('Content-Type',$self->{'content-type'} || 'text/html'); $ref->('X-YADIS-Location',$self->{'yadis-location'}); } 1;