File: 04-response.t

package info (click to toggle)
libnet-oauth-perl 0.31-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 308 kB
  • sloc: perl: 1,484; makefile: 8
file content (33 lines) | stat: -rw-r--r-- 758 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!perl

use strict;
use warnings;
use Test::More tests => 5;

BEGIN {
    use Net::OAuth;
    $Net::OAuth::PROTOCOL_VERSION = Net::OAuth::PROTOCOL_VERSION_1_0;
    use_ok( 'Net::OAuth::Response' );
    use_ok( 'Net::OAuth::RequestTokenResponse' );
    use_ok( 'Net::OAuth::AccessTokenResponse' );
}

my $response = Net::OAuth::RequestTokenResponse->new(
	token => 'abcdef',
	token_secret => '0123456',
	extra_params => {
		foo => 'bar',
	},
);

is($response->to_post_body, 'foo=bar&oauth_token=abcdef&oauth_token_secret=0123456');

$response = Net::OAuth::AccessTokenResponse->new(
	token => 'abcdef',
	token_secret => '0123456',
	extra_params => {
		foo => 'bar',
	},
);

is($response->to_post_body, 'foo=bar&oauth_token=abcdef&oauth_token_secret=0123456');