Debian Codegraph @

t/LWP/Authen/OAuth2/ServiceProvider.t

raw
1 #! /usr/bin/env perl
2 use 5.006;
3 use strict;
4 use warnings FATAL => 'all';
5 use Test::More;
6
7 use FindBin qw($Bin);
8 use lib "$Bin/../../../../lib";
9
10 BEGIN {
11 use_ok( 'LWP::Authen::OAuth2::ServiceProvider' ) || print "Bail out!\n";
12 use LWP::Authen::OAuth2;
13
14 my $oauth2 = LWP::Authen::OAuth2->new(
15 is_strict => 0,
16 client_id => 'Test',
17 client_secret => 'Test',
18 );
19
20 my $service_provider = LWP::Authen::OAuth2::ServiceProvider->new({
21 request_default_params => {
22 key1 => 'value1',
23 },
24 });
25
26 my $params = $service_provider->collect_action_params(
27 'request',
28 $oauth2,
29 );
30
31 is_deeply(
32 $params,
33 {
34 client_id => 'Test',
35 client_secret => 'Test',
36 key1 => 'value1',
37 },
38 'collect_action_params - no strict mode, keep default values if not specified elsewhere',
39 );
40 }
41
42 done_testing();