NAME

OAuth::Lite2::Agent::PSGIMock - Agent class for test which use PSGI App

SYNOPSIS

use Test::More;

my $endpoit = OAuth::Lite2::Server::Endpoint::Token->new(
    data_handler => 'YourApp::DataHandler',
);

my $agent = OAuth::Lite2::Agent::PSGIMock->new( app => $endpoint );

my $client = OAuth::Lite2::Client::UsernameAndPassword->new(
    client_id     => q{foo},
    client_secret => q{bar},
    agent         => $agent,
);

my $res = $client->get_access_token(
    username => q{buz},
    password => q{huga},
    scope    => q{email},
);

is($res->access_token, ...);
is($res->refresh_token, ...);

DESCRIPTION

This class is useful for test to check if your PSGI based server application acts as expected.

METHODS

new (%args)

parameters

app (PSGI application)

request ($req)

handle request with PSIG application you set at constructor

SEE ALSO

OAuth::Lite2::Client::Agent, OAuth::Lite2::Client::Agent::Strict OAuth::Lite2::Client::Agent::Dump

AUTHOR

Lyo Kato, lyo.kato _at_ gmail.com

COPYRIGHT AND LICENSE

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.