HTTP::Session::State::Test - state module for testing


HTTP-Session documentation Contained in the HTTP-Session distribution.

Index


Code Index:

NAME

Top

HTTP::Session::State::Test - state module for testing

SYNOPSIS

Top

    HTTP::Session->new(
        state => HTTP::Session::State::Test->new(
            session_id => 'foobar',
        ),
        store => ...,
        request => ...,
    );

DESCRIPTION

Top

This is an mock object for testing session.

CONFIGURATION

Top

session_id

dummy session id

METHODS

Top

get_session_id
response_filter

for internal use only

SEE ALSO

Top

HTTP::Session


HTTP-Session documentation Contained in the HTTP-Session distribution.

package HTTP::Session::State::Test;
use strict;
use HTTP::Session::State::Base;

__PACKAGE__->mk_ro_accessors(qw/session_id/);

sub new {
    my $class = shift;
    my %args = ref($_[0]) ? %{$_[0]} : @_;
    # check required parameters
    for (qw/session_id/) {
        Carp::croak "missing parameter $_" unless $args{$_};
    }
    # set default values
    bless {%args}, $class;
}

sub get_session_id {
    my $self = shift;
    return $self->session_id;
}
sub response_filter { }

1;
__END__