line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package CatalystX::Eta::Test::REST; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
65139
|
use base qw(Stash::REST); |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
1634
|
|
4
|
2
|
|
|
2
|
|
161027
|
use strict; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
103
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
CatalystX::Eta::Test::REST->add_trigger( 'process_response' => \&on_process_response ); |
7
|
|
|
|
|
|
|
|
8
|
2
|
|
|
2
|
|
14
|
use Test::More; |
|
2
|
|
|
|
|
12
|
|
|
2
|
|
|
|
|
38
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub on_process_response { |
11
|
16
|
|
|
16
|
0
|
503918
|
my ( $self, $opt ) = @_; |
12
|
|
|
|
|
|
|
|
13
|
16
|
|
|
|
|
64
|
my $req = $opt->{req}; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
my $desc = join ' ', $req->method, $req->uri->path, |
16
|
16
|
100
|
|
|
|
145
|
'-> ' . $opt->{conf}->{code} . ( $opt->{conf}{is_fail} ? ' is fail' : '' ); |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
is( |
19
|
|
|
|
|
|
|
$opt->{res}->code, |
20
|
|
|
|
|
|
|
$opt->{conf}->{code}, |
21
|
16
|
100
|
|
|
|
778
|
$desc . ( exists $opt->{conf}->{name} ? ' - ' . $opt->{conf}->{name} : '' ) |
22
|
|
|
|
|
|
|
); |
23
|
|
|
|
|
|
|
|
24
|
16
|
50
|
|
|
|
10227
|
if ( $opt->{res}->code != $opt->{conf}->{code} ) { |
25
|
0
|
|
|
|
|
|
eval('use DDP; my $x= $opt->{res}; p $x '); |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
1; |