logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

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

Author

       Lyo Kato, "lyo.kato _at_ gmail.com"

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

Name

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

   SYNOPSIS
           use Test::More;

           my $endpoint = 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, ...);

See Also

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

See Also